/* PRESETLK theme: only the tokens this app uses. `.dark` on <html> switches to dark, which is the
   default until the visitor picks light with the toggle.
   --primary is overridden inline when the owner picks a brand colour. */
:root {
  --background: #F5F6F8;
  --foreground: #18181B;
  --card: #FFFFFF;
  --primary: #18181B;
  --primary-foreground: #FFFFFF;
  --muted: #F4F4F5;
  --muted-foreground: #71717A;
  --accent: #F4F4F5;
  --destructive: #EF4444;
  --positive: #22c55e;
  --border: #E4E4E7;
  --input: #E4E4E7;
  --ring: #18181B;
  --radius: 0.5rem;
  color-scheme: light;
}
.dark {
  --background: #09090B;
  --foreground: #FAFAFA;
  --card: #18181B;
  --primary: #FAFAFA;
  --primary-foreground: #18181B;
  --muted: #27272A;
  --muted-foreground: #A1A1AA;
  --accent: #27272A;
  --border: #27272A;
  --input: #27272A;
  --ring: #D4D4D8;
  color-scheme: dark;
}

.btn.theme-toggle { margin-left: auto; width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; }
.theme-toggle svg { width: 18px; height: 18px; }
.dark .theme-toggle .moon, :root:not(.dark) .theme-toggle .sun { display: none; } /* show the mode you'd switch to */

* { box-sizing: border-box; border-color: var(--border); }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.5 'Geist Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3 { margin: 0 0 4px; line-height: 1.2; }
h1 { font-size: 26px; letter-spacing: -0.02em; }
h2 { font-size: 17px; margin-bottom: 14px; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 980px; transition: max-width .2s; margin: 0 auto; padding: 28px 16px 64px; display: grid; gap: 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { height: 56px; max-width: 160px; object-fit: contain; }
.brand .grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); padding: 20px; }
.muted { color: var(--muted-foreground); margin: 0; }
.small { font-size: 13px; }
.error { color: var(--destructive); margin: 8px 0 0; min-height: 1em; }

.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 300px) 1fr; }
@media (max-width: 700px) { .split { grid-template-columns: 1fr; } }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.actions .grow { flex: 1; }

label { display: block; font-size: 14px; font-weight: 500; }
label > input, label > select, label > textarea { margin-top: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
.wide { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit; width: 100%; padding: 8px 10px; color: inherit;
  background: var(--card); border: 1px solid var(--input); border-radius: var(--radius);
}
/* brand colour picker: a round swatch with a thin white ring instead of a wide box */
input[type=color] { display: block; -webkit-appearance: none; appearance: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 2px solid #fff; border-radius: 50%; }
input[type=color]::-moz-color-swatch { border: 2px solid #fff; border-radius: 50%; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.btn {
  font: inherit; font-weight: 500; cursor: pointer; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-foreground); text-decoration: none; display: inline-block;
}
.btn.ghost { background: transparent; color: var(--foreground); border-color: var(--border); }
.btn.danger { color: var(--destructive); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* packages */
.pkg { text-align: left; font: inherit; color: inherit; cursor: pointer; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.pkg strong { display: block; font-size: 16px; }
.pkg .price { font-weight: 600; margin: 6px 0; }
.pkg[aria-pressed=true] { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }

/* calendar + slots */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: 12px; color: var(--muted-foreground); padding: 4px 0; }
.cal button, .slot {
  font: inherit; color: inherit; cursor: pointer; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius); padding: 8px 0;
}
.cal button:not(:disabled):hover, .slot:not(:disabled):hover { border-color: var(--border); background: var(--accent); }
.cal button:disabled { color: var(--muted-foreground); opacity: .4; cursor: default; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }
.slot { border-color: var(--border); }
.slot:disabled { text-decoration: line-through; opacity: .4; cursor: not-allowed; }
.cal button.sel, .slot.sel { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

dialog.dialog {
  border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); background: var(--card); color: var(--foreground);
  padding: 20px; width: min(600px, calc(100% - 32px)); max-height: calc(100% - 32px);
}
dialog.dialog::backdrop { background: rgb(0 0 0 / .55); }
.pkg-item { padding: 0; }
.pkg-item > summary {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px; cursor: pointer; list-style: none; border-radius: var(--radius);
}
.pkg-item > summary::-webkit-details-marker { display: none; }
.pkg-item > summary::after { content: '▾'; color: var(--muted-foreground); transition: transform .15s; }
.pkg-item[open] > summary::after { transform: rotate(180deg); }
.pkg-item > summary:hover { background: var(--accent); }
.pkg-item > summary .grow { flex: 1; min-width: 160px; }
.pkg-item .pkg-name { font-weight: 600; }
.pkg-item > form { padding: 0 14px 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.card-fields { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; margin: 12px 0 0; display: grid; gap: 12px; }
.card-fields legend { font-size: 13px; font-weight: 600; padding: 0 6px; }

/* packages & pricing section */
#pricing { display: grid; gap: 16px; margin-top: 24px; }
.section-title { font-size: 20px; letter-spacing: -0.01em; margin: 0; }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.plan { display: flex; flex-direction: column; gap: 12px; position: relative; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.plan:hover { border-color: var(--muted-foreground); }
.plan.selected { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.plan-flag {
  position: absolute; top: -11px; left: 20px; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px;
  background: var(--primary); color: var(--primary-foreground);
}
#packages { padding-top: 6px; } /* room for the highlight label */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-head h3 { font-size: 17px; margin: 0; }
.plan .amount { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.1; }
.plan .amount span { font-size: 14px; font-weight: 400; color: var(--muted-foreground); letter-spacing: 0; }
.ticks { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 14px; }
.ticks li { display: flex; gap: 8px; }
.ticks li::before { content: '✓'; color: var(--positive); font-weight: 700; }
.plan .btn { margin-top: auto; text-align: center; }
.info h3 { font-size: 17px; margin: 0 0 14px; }
.info-list { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 0; }
.info-list dt { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-foreground); margin-bottom: 2px; }
.info-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.info .policy { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.info .policy h3 { margin-bottom: 12px; }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.terms li { display: grid; grid-template-columns: 20px minmax(0, 1fr); overflow-wrap: anywhere; gap: 10px; align-items: start; line-height: 1.5; }
.terms li::before { /* check-in-circle bullet, drawn with the brand colour so it follows light/dark */
  content: ''; width: 20px; height: 20px; margin-top: 1px; background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m8 12.5 2.8 2.8L16 9.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.terms-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; font-size: 14px; }
.terms-box > summary { cursor: pointer; color: var(--muted-foreground); }
.terms-box[open] > summary { margin-bottom: 12px; }

/* booking wizard */
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.stepper li { display: grid; gap: 6px; font-size: 13px; color: var(--muted-foreground); }
.stepper li::before { content: ''; height: 4px; border-radius: 2px; background: var(--border); }
.stepper li.done::before, .stepper li.current::before { background: var(--primary); }
.stepper li.current { color: var(--foreground); font-weight: 600; }
.step-nav {
  position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--background) 90%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
}
.step-nav .error { margin: 0 0 8px; min-height: 0; }
.step-nav .error:empty { display: none; }
.step-nav .row { display: flex; align-items: center; gap: 10px; }
.step-nav .grow { flex: 1; min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 600px) {
  .stepper li { font-size: 11.5px; }
  .card { padding: 16px; }
  .step-nav .btn { padding: 11px 16px; }
}
.review { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 14px; font-size: 14px; }
.review dt { color: var(--muted-foreground); }
.review dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .review { grid-template-columns: 1fr; gap: 0; } .review dd { margin-bottom: 8px; } }

.summary { background: var(--muted); border-radius: var(--radius); padding: 12px 14px; margin: 14px 0; }

/* form fields (booking form + builder preview) */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { grid-column: span 2; display: grid; gap: 6px; align-content: start; }
.field.half { grid-column: span 1; }
@media (max-width: 600px) { .field.half { grid-column: span 2; } }
.field > label, .field legend { font-size: 14px; font-weight: 500; }
.field > label > input, .field > label > select { margin-top: 0; }
.field.heading h3 { font-size: 16px; margin: 8px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.field fieldset { border: 0; padding: 0; margin: 0; }
.field legend { padding: 0; margin-bottom: 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.field .help { font-size: 12.5px; }
.req { color: var(--destructive); }
.field input[type=range] { padding: 0; accent-color: var(--primary); }
.field output { font-weight: 600; margin-left: 6px; }
.field input[type=file] { padding: 6px; }
.captcha-preview { border: 1px solid var(--border); border-radius: 4px; padding: 14px; width: 300px; max-width: 100%; background: var(--muted); }

/* form builder (WPForms-style): sidebar with tabs + live form preview */
.fb-card { padding: 0; overflow: clip; }
.fb-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.fb-top h2 { margin: 0; font-size: 17px; }
.fb-top .grow { flex: 1; min-width: 200px; }
.unsaved { font-size: 13px; color: var(--muted-foreground); display: inline-flex; align-items: center; gap: 6px; }
.unsaved::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #f59e0b; }
.builder { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: start; }
.fb-side { border-right: 1px solid var(--border); position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; background: var(--card); }
.fb-side [hidden] { display: none !important; }
.fb-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); z-index: 2; }
.fb-tabs button { font: inherit; font-weight: 500; padding: 13px 8px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted-foreground); cursor: pointer; }
.fb-tabs button[aria-selected=true] { color: var(--foreground); border-bottom-color: var(--primary); }
.pal-search { position: relative; margin: 14px 16px 6px; }
.pal-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); }
.pal-search input { padding-left: 36px; }
.pal-group { padding: 6px 16px 10px; }
.pal-group > summary { cursor: pointer; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-foreground); padding: 8px 0; list-style: none; display: flex; justify-content: space-between; }
.pal-group > summary::-webkit-details-marker { display: none; }
.pal-group > summary::after { content: '▾'; transition: transform .15s; }
.pal-group:not([open]) > summary::after { transform: rotate(-90deg); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile {
  font: inherit; font-size: 12.5px; color: inherit; cursor: grab; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center;
  padding: 12px 4px; min-height: 76px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color .12s, background .12s;
}
.tile .ic { color: var(--muted-foreground); transition: color .12s; }
.tile:hover { border-color: var(--primary); background: var(--accent); }
.tile:hover .ic { color: var(--foreground); }
.tile:active { cursor: grabbing; }

.fb-stage { background: var(--muted); padding: 28px 20px 36px; min-width: 0; }
.fb-form { max-width: 720px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: 0 1px 3px rgb(0 0 0 / .08); }
.fb-form-head { padding: 22px 28px 0; }
.fb-form-head h3 { margin: 0 0 4px; font-size: 20px; letter-spacing: -.01em; }
.canvas { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; align-content: start; min-height: 200px; border-radius: var(--radius); transition: background .12s; }
.canvas.drag-over { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.fb-submit { padding: 4px 28px 26px; }
.fb-submit .btn { pointer-events: none; }

.canvas-item { grid-column: span 2; position: relative; padding: 14px 16px 12px 26px; border: 1px dashed transparent; border-radius: var(--radius); cursor: pointer; transition: border-color .12s, background .12s; }
.canvas-item.half { grid-column: span 1; }
.canvas-item:hover { border-color: var(--input); background: color-mix(in srgb, var(--muted) 45%, transparent); }
.canvas-item.sel { border: 1px solid var(--primary); background: color-mix(in srgb, var(--primary) 4%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent); }
.canvas-item.dragging { opacity: .35; }
.canvas-item.drop-before { box-shadow: 0 -3px 0 var(--primary); }
.canvas-item.drop-after { box-shadow: 0 3px 0 var(--primary); }
.canvas-item .field { pointer-events: none; }
.canvas-item .grip { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); color: var(--muted-foreground); opacity: 0; cursor: grab; }
.canvas-item:hover .grip, .canvas-item.sel .grip { opacity: .8; }
.item-chip {
  position: absolute; top: -11px; left: 14px; display: none; align-items: center; gap: 5px; z-index: 1;
  font-size: 11.5px; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 99px; background: var(--primary); color: var(--primary-foreground);
}
.canvas-item.sel .item-chip, .canvas-item:hover .item-chip { display: inline-flex; }
.item-tools { position: absolute; top: -13px; right: 12px; display: none; gap: 2px; padding: 2px; z-index: 1; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 2px 6px rgb(0 0 0 / .12); }
.canvas-item:hover .item-tools, .canvas-item.sel .item-tools, .canvas-item:focus-within .item-tools { display: flex; }
.item-tools button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--foreground); cursor: pointer; }
.item-tools button:hover:not(:disabled) { background: var(--accent); }
.item-tools button.del:hover:not(:disabled) { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }
.item-tools button:disabled { opacity: .3; cursor: default; }
.item-badges { display: flex; gap: 4px; margin-bottom: 6px; }

/* field options */
.pad { padding: 16px; }
.opt-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.opt-head .ic { padding: 8px; box-sizing: content-box; border-radius: var(--radius); background: var(--muted); }
.opt-head div { display: grid; line-height: 1.3; }
.subtabs { display: flex; gap: 4px; margin: 0 16px; padding: 3px; background: var(--muted); border-radius: var(--radius); }
.subtabs button { flex: 1; font: inherit; font-size: 13.5px; padding: 7px 6px; border: 0; background: none; color: var(--muted-foreground); border-radius: calc(var(--radius) * .8); cursor: pointer; white-space: nowrap; }
.subtabs button[aria-selected=true] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .1); }
.subtabs .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); vertical-align: middle; }
.opt-body { padding: 16px; display: grid; gap: 14px; }
.grid2, .grid3 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.note { margin: 0; font-size: 13px; color: var(--muted-foreground); background: var(--muted); border-radius: var(--radius); padding: 10px 12px; }
.note.warn { color: var(--destructive); background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 14px; cursor: pointer; }
.switch input { appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 22px; padding: 0; margin: 0; border: 0; border-radius: 99px; background: var(--input); position: relative; cursor: pointer; transition: background .15s; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted-foreground); transition: transform .15s, background .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(18px); background: var(--primary-foreground); }
.switch input:disabled { opacity: .55; cursor: not-allowed; }
.logic-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.logic-line select { width: auto; padding: 6px 10px; }
.rule { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px; border-radius: var(--radius); background: var(--muted); }
.rule > :nth-child(3) { grid-column: span 2; }
.rule .btn { justify-self: end; grid-column: span 2; }

@media (max-width: 1000px) {
  .builder { grid-template-columns: 1fr; }
  .fb-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border); }
  .fb-tabs { position: static; }
  .fb-stage { padding: 20px 12px 28px; }
}

/* admin */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--muted); padding: 4px; border-radius: var(--radius); }
.tabs button { font: inherit; color: var(--muted-foreground); background: transparent; border: 0; border-radius: calc(var(--radius) * .8); padding: 6px 12px; cursor: pointer; }
.tabs button[aria-selected=true] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.row-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 500; color: var(--muted-foreground); }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--muted); }
.badge.ok { background: color-mix(in srgb, var(--positive) 18%, transparent); }
.badge.bad { background: color-mix(in srgb, var(--destructive) 18%, transparent); }
.logo-preview { height: 64px; max-width: 200px; object-fit: contain; border: 1px dashed var(--border); border-radius: var(--radius); padding: 4px; }
code { background: var(--muted); padding: 1px 6px; border-radius: 4px; font-size: 13px; word-break: break-all; }
#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--foreground); color: var(--background); padding: 10px 16px; border-radius: var(--radius);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: 1; }

/* ---------- responsive: tablet (<= 900px) and phone (<= 600px) ---------- */
.wrap > *, #app > * { min-width: 0; } /* grid children may shrink instead of stretching the page */
img, svg { max-width: 100%; }

@media (max-width: 900px) {
  .wrap { padding: 20px 16px 48px; }
  /* bookings table -> one card per booking */
  #bookings, #bookings tbody, #bookings tr, #bookings td { display: block; }
  #bookings thead { display: none; }
  #bookings tr { border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; margin-bottom: 12px; }
  #bookings tr.is-cancelled { opacity: .7; }
  #bookings td { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); }
  #bookings td::before { content: attr(data-label); color: var(--muted-foreground); font-size: 13px; }
  #bookings td:empty, #bookings td.row-actions::before { display: none; }
  /* collapsed card: date, time, phone + WhatsApp. Tap to reveal the rest. */
  #bookings tr:not(.open) td:not(.bk-sum) { display: none; }
  #bookings td[data-label="When"], #bookings td[data-label="Package"], #bookings td[data-label="Total"], #bookings td[data-label="Category"], #bookings td.no-email { display: none; } /* already in the card header */
  #bookings .cust strong, #bookings .cust-phone { display: none; }
  #bookings td.bk-sum { display: block; padding: 0; border-bottom: 0; }
  #bookings td.bk-sum::before { display: none; }
  #bookings tr.open td.bk-sum { border-bottom: 1px solid var(--border); }
  .bk-toggle { cursor: pointer; padding: 12px 0; display: grid; gap: 10px; border-radius: var(--radius); }
  .bk-when { display: flex; align-items: center; gap: 10px; }
  .bk-when strong { font-size: 16px; }
  .bk-when span:not(.badge) { color: var(--muted-foreground); }
  .bk-when .chev { margin-left: auto; width: 9px; height: 9px; border: solid var(--muted-foreground); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
  #bookings tr.open .chev { transform: rotate(-135deg); }
  .bk-who { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
  .bk-who strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
  .bk-who .badge { font-size: 12.5px; padding: 2px 10px; }
  .bk-pkg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--muted); font-size: 14px; }
  .bk-pkg span { color: var(--muted-foreground); overflow-wrap: anywhere; }
  .bk-pkg strong { white-space: nowrap; }
  .bk-contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
  .bk-phone { font-weight: 500; font-size: 16px; }
  .btn.wa { background: #25D366; border-color: #25D366; color: #06281a; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

  #bookings td.blank { display: none; }
  #bookings td:last-child { border-bottom: 0; }
  #bookings td.row-actions { display: block; padding: 12px 0 8px; }
  #bookings .acts { display: flex; flex-wrap: wrap; gap: 8px; }
  #bookings .acts .btn { flex: 1 1 auto; }
  #bookings td[colspan], #bookings td.muted { display: block; border: 0; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  h1 { font-size: 22px; }
  input, select, textarea { font-size: 16px; padding: 10px 12px; } /* 16px stops iOS zooming the page on focus */
  .btn { padding: 11px 16px; }
  .btn.sm { padding: 8px 12px; font-size: 14px; }
  .card { padding: 16px; }
  .brand { gap: 10px; }
  .brand img { height: 44px; max-width: 120px; }

  /* admin tabs: one swipeable row */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; flex: 0 0 auto; padding: 9px 14px; }

  .grid { grid-template-columns: minmax(0, 1fr); }
  #bookings td { grid-template-columns: 84px minmax(0, 1fr); gap: 8px; padding: 7px 0; }
  .actions .btn { flex: 1 1 auto; }
  .actions .btn.sm { flex: 0 0 auto; } /* small buttons (close ✕, Save/Delete) keep their size */
  .pkg-item > summary { padding: 12px; }
  .row-card { padding: 12px; }
  .plans { grid-template-columns: 1fr; }
  .plan .amount { font-size: 26px; }
  .info-list { grid-template-columns: 1fr 1fr; }
  .cal button, .slot { padding: 11px 0; } /* bigger touch targets */
  .slots { grid-template-columns: repeat(3, 1fr); }
  .canvas { grid-template-columns: 1fr; padding: 14px 8px; }
  .canvas-item, .canvas-item.half { grid-column: auto; }
  .item-tools, .item-chip { display: flex; } /* no hover on touch screens */
  .item-chip { display: none; }
  .canvas-item.sel .item-chip { display: inline-flex; }
  .item-tools button { width: 34px; height: 34px; }
  .fb-form-head { padding: 18px 16px 0; } .fb-submit { padding: 4px 16px 20px; }
  .fb-top { padding: 12px 14px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  dialog.dialog { padding: 16px; width: calc(100% - 20px); }
  .rule { grid-template-columns: 1fr; }
  .rule > :nth-child(3), .rule .btn { grid-column: auto; }
}

input[type=file] { max-width: 100%; min-width: 0; }

/* long unbroken words (URLs, typos) wrap instead of stretching cards past the screen */
.plan, .info, .summary, .review, .field, .pkg-name, #bookings td, .brand h1, .brand p { overflow-wrap: anywhere; }

.wrap.wide { max-width: 1280px; }

.bk-sum { display: none; } /* summary cell is only used by the phone card layout */

/* bookings table (desktop) */
@media (min-width: 901px) { /* table layout only; phones/tablets use the card layout above */
  #bookings td.nowrap { white-space: nowrap; }
  #bookings td.row-actions { width: 1%; white-space: nowrap; }
  .acts { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
}
.cust { display: grid; gap: 3px; justify-items: start; }
.cust-phone { display: flex; align-items: center; gap: 8px; }
.cust-phone a { text-decoration: none; }
.wa-ico { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #25D366; color: #06281a; }
.wa-ico svg { width: 11px; height: 11px; }

/* booking details dialog */
.detail-list { display: grid; margin: 12px 0 0; }
.detail-list > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt { color: var(--muted-foreground); font-size: 14px; }
.detail-list dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.detail-phone { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
@media (max-width: 600px) { .detail-list > div { grid-template-columns: 1fr; gap: 2px; } }

/* WhatsApp button (also used in the details dialog on desktop) */
.btn.wa { background: #25D366; border-color: #25D366; color: #06281a; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

.link { font: inherit; font-size: 14px; background: none; border: 0; padding: 4px 0; color: var(--muted-foreground); text-decoration: underline; cursor: pointer; }
.link:hover { color: var(--foreground); }

/* login / reset screens: plain centred form, no admin header */
.auth .wrap { max-width: 440px; }
.auth .brand > div, .auth .brand > img, .auth #logout { display: none !important; }
.auth .brand { justify-content: flex-end; }
.auth-head { display: none; }
.auth .auth-head { display: block; margin-top: 6vh; }
.auth-head img { display: block; height: 48px; max-width: 220px; object-fit: contain; }
.wordmark { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.auth-form { display: grid; gap: 16px; margin-top: 4px; }
.auth-form h2 { font-size: 26px; letter-spacing: -.02em; margin: 0; }
.auth-form .sub { margin: -8px 0 0; }
.auth-form input:not([type=checkbox]) { height: 44px; border-radius: 10px; }
.auth-form .btn.block { width: 100%; padding: 12px; border-radius: 10px; font-weight: 600; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-row .link { color: var(--foreground); font-weight: 600; text-decoration: none; }
.auth-row .link:hover { text-decoration: underline; }

/* login: studio name/logo centred, theme toggle pinned to the page's top-right corner */
.auth .auth-head { text-align: center; }
.auth-head img { margin: 0 auto; }
.auth .brand { position: static; }
.auth .brand .theme-toggle { position: fixed; top: 16px; right: 16px; margin: 0; }

/* login: a centred card with a drop shadow, lifted off the page background */
.auth .wrap { max-width: none; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; display: grid; place-items: center; align-content: center; }
.auth .brand { display: contents; } /* only the fixed theme toggle remains from the header */
.auth .auth-card {
  width: min(100%, 420px); padding: 32px 28px; display: grid; gap: 20px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / .05), 0 12px 32px -6px rgb(0 0 0 / .14), 0 28px 60px -18px rgb(0 0 0 / .18);
}
.dark .auth .auth-card { box-shadow: 0 0 0 1px rgb(255 255 255 / .04), 0 18px 40px -8px rgb(0 0 0 / .75), 0 40px 90px -24px rgb(0 0 0 / .9); }
.auth .auth-head { margin: 0; }
.auth .auth-card input:not([type=checkbox]) { background: var(--background); } /* fields stand out from the card */
.auth .auth-card .auth-form { margin: 0; }
@media (max-width: 480px) { .auth .auth-card { padding: 24px 20px; border-radius: 14px; } }
.auth-form .error:empty { display: none; } /* no blank gap under the button until there is a message */

/* ---------- phone navigation: floating bottom bar + slide-out menu ---------- */
.mnav, .drawer, .drawer-back { display: none; }
@media (max-width: 700px) {
  body.admin:not(.auth) .tabs, body.admin:not(.auth) .brand .theme-toggle, body.admin:not(.auth) .brand #logout { display: none; } /* these live in the menu now */
  body.admin:not(.auth) .wrap { padding-bottom: 112px; } /* room above the bar */
  #toast { bottom: 100px; }
  body.no-scroll { overflow: hidden; }

  .mnav {
    display: flex; align-items: center; justify-content: space-between; gap: 2px; position: fixed; z-index: 40;
    left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
    width: min(calc(100% - 24px), 440px); padding: 8px;
    background: color-mix(in srgb, var(--card) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border: 1px solid var(--border); border-radius: 999px; box-shadow: 0 12px 32px rgb(0 0 0 / .3);
  }
  .mnav button {
    font: inherit; display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; min-width: 48px; padding: 0 12px;
    border: 0; border-radius: 999px; background: none; color: var(--muted-foreground); cursor: pointer; transition: background .2s, color .2s, padding .2s;
  }
  .mnav button span { display: none; font-weight: 600; font-size: 15px; white-space: nowrap; }
  .mnav button.active { background: var(--primary); color: var(--primary-foreground); padding: 0 18px; }
  .mnav button.active span { display: inline; }
  .mnav button:not(.active):hover { color: var(--foreground); }

  .drawer-back { display: block; position: fixed; inset: 0; z-index: 50; background: rgb(0 0 0 / .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .drawer-back.open { opacity: 1; pointer-events: auto; }
  .drawer {
    display: flex; flex-direction: column; gap: 8px; position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(86vw, 320px);
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; background: var(--card); border-left: 1px solid var(--border);
    box-shadow: -24px 0 60px rgb(0 0 0 / .4); transform: translateX(100%); transition: transform .25s ease; visibility: hidden;
  }
  .drawer.open { transform: none; visibility: visible; }
  .drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 6px 12px; font-size: 17px; }
  .drawer-close { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: none; color: var(--foreground); cursor: pointer; }
  .drawer-nav { display: grid; gap: 4px; }
  .drawer-nav button {
    font: inherit; font-weight: 500; display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 12px; text-align: left;
    border: 0; border-radius: 12px; background: none; color: var(--foreground); cursor: pointer;
  }
  .drawer-nav button .ic { color: var(--muted-foreground); }
  .drawer-nav button.active { background: var(--accent); font-weight: 600; }
  .drawer-nav button.active .ic { color: var(--foreground); }
  .drawer-foot { margin-top: auto; display: grid; gap: 14px; padding: 14px 6px 0; border-top: 1px solid var(--border); }
  .drawer-link { color: var(--foreground); text-decoration: none; font-weight: 500; padding: 4px 0; }
  .drawer-foot .btn { width: 100%; }
}

@media (max-width: 900px) { /* empty list: show the message as plain text, not an empty card */
  #bookings tr:not(.open) td.bk-empty { display: block; padding: 8px 0; border: 0; }
  #bookings tr:has(td.bk-empty) { border: 0; padding: 0; }
}


/* ---------- admin shell: sidebar + top bar + page ---------- */
body.admin:not(.auth) .wrap { max-width: none; padding: 0; display: block; }
body.admin:not(.auth) .wrap > .brand { display: none; } /* the old header; its (hidden) theme button still drives the toggle */
#app { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; transition: grid-template-columns .2s ease; }
#app.rail { grid-template-columns: 76px minmax(0, 1fr); }
#app > * { min-width: 0; }

.side { position: sticky; top: 0; align-self: start; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden auto; background: var(--background); border-right: 1px solid var(--border); }
.side-brand { height: 64px; flex: none; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--border); }
.side-brand img { display: block; height: 30px; max-width: 176px; object-fit: contain; }
.side-brand .wordmark { font-size: 19px; }
.side-mono { display: none; width: 36px; height: 36px; place-items: center; border-radius: 10px; background: var(--primary); color: var(--primary-foreground); font-weight: 700; font-size: 17px; }
.side-nav { padding: 12px; display: grid; gap: 14px; align-content: start; }
.side-group { display: grid; gap: 4px; }
.side-label { padding: 10px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .09em; color: var(--muted-foreground); }
.side-nav button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--muted-foreground); font: inherit; font-weight: 500; text-align: left; cursor: pointer; transition: background .12s, color .12s;
}
.side-nav button:hover { background: color-mix(in srgb, var(--card) 60%, transparent); color: var(--foreground); }
.side-nav button.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--border); color: var(--foreground); font-weight: 600; }
.side-nav button.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.side-foot { margin-top: auto; padding: 12px; display: grid; gap: 6px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.avatar { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--muted); }
.side-user > div { display: grid; min-width: 0; line-height: 1.3; }
.side-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.side-user small { font-size: 12px; }
.side-logout { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: var(--destructive); font: inherit; font-weight: 500; cursor: pointer; }
.side-logout:hover { background: color-mix(in srgb, var(--destructive) 12%, transparent); }

/* icon-only rail */
#app.rail .side-brand { justify-content: center; padding: 0; }
#app.rail .side-brand-full, #app.rail .side-label, #app.rail .side-nav button span, #app.rail .side-user > div, #app.rail .side-logout span:last-child { display: none; }
#app.rail .side-mono { display: grid; }
#app.rail .side-nav button, #app.rail .side-logout { justify-content: center; padding: 12px 0; }
#app.rail .side-group + .side-group { padding-top: 14px; border-top: 1px solid var(--border); }
#app.rail .side-user { justify-content: center; padding: 8px 0; border: 0; background: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: color-mix(in srgb, var(--background) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar .grow { flex: 1; }
.topbar .theme-toggle { margin-left: 0; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: none; color: var(--foreground); cursor: pointer; }
.icon-btn:hover { background: var(--accent); }
.mob-brand { display: none; align-items: center; }
.mob-brand img { display: block; height: 28px; max-width: 150px; object-fit: contain; }

.page { width: 100%; max-width: 1480px; margin: 0 auto; padding: 28px 32px 56px; display: grid; gap: 20px; align-content: start; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.page-head h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: -.02em; }
.page-head p { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; }
[data-panel] > h2:first-child, [data-panel="bookings"] h2.grow { display: none; } /* the page title above replaces each card's own heading */
[data-panel="bookings"] > .actions { justify-content: flex-end; }

/* dashboard */
.dash { display: grid; gap: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { display: grid; gap: 6px; padding: 20px 22px; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted-foreground); }
.stat strong { font-size: clamp(21px, 2.1vw, 28px); line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; }
.stat-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.dash-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-card h3 { margin: 0 0 2px; font-size: 17px; }
.dash-card > p { margin: 0 0 16px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted-foreground); font-size: 11px; }
.chart .g { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: color-mix(in srgb, var(--primary) 9%, transparent); }
.chart circle { fill: var(--card); stroke: var(--primary); stroke-width: 2; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 130px) 1fr 28px; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; }
.bar-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted-foreground); }
.bar { height: 12px; border-radius: 99px; background: var(--muted); }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.bar-row b { text-align: right; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); }
.list-row:first-child { border-top: 0; padding-top: 0; }
.list-row > div:first-child, .list-row .grow { display: grid; flex: 1; min-width: 0; gap: 2px; }
.list-meta { display: grid; justify-items: end; gap: 4px; }
.dot-ico { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--positive) 16%, transparent); color: var(--positive); }

@media (min-width: 1001px) { .fb-side { top: 64px; max-height: calc(100vh - 64px); } } /* sit below the sticky top bar */
@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid, .dash-grid.even { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 24px 20px 48px; }
  .topbar { padding: 0 20px; }
  #sideToggle { display: none; }
}
@media (max-width: 700px) {
  #app, #app.rail { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .topbar { height: 56px; padding: 0 16px; }
  .topbar .icon-btn, .topbar .theme-toggle { display: none; } /* theme + logout are in the phone menu */
  .mob-brand { display: flex; }
  .page { padding: 20px 16px 112px; gap: 16px; }
  .page-head h1 { font-size: 24px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; text-align: center; }
  .stat { padding: 16px; }
  .stat strong { font-size: 22px; }
  .stat-top { font-size: 11px; letter-spacing: .05em; }
}

@media (min-width: 901px) { /* table view: keep names and numbers whole; only emails may break */
  #bookings td { overflow-wrap: normal; }
  #bookings .cust strong, #bookings .cust-phone a { white-space: nowrap; }
  #bookings .cust .small { overflow-wrap: anywhere; }
}
.page { grid-template-columns: minmax(0, 1fr); } /* wide content (tables, builder) scrolls inside its card instead of stretching the page */

/* logos: with two uploaded, show the one that suits the current mode */
.dark .logo-l, :root:not(.dark) .logo-d { display: none !important; }
.logo-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 14px; }
.logo-slot { display: grid; gap: 6px; align-content: start; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.slot-title { font-size: 14px; font-weight: 600; }
.logo-stage { height: 96px; display: grid; place-items: center; border-radius: var(--radius); border: 1px solid var(--border); margin-top: 4px; }
.logo-stage img { max-height: 72px; max-width: 80%; object-fit: contain; }
.dark-stage { background: #09090B; }
.light-stage { background: #FFFFFF; }
.logo-slot .actions { margin-top: 4px; }
.file-btn { cursor: pointer; }

/* sidebar + phone header: logo then studio name */
.side-brand-full, .mob-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.side-brand-full img, .mob-brand img { height: 32px; max-width: 84px; object-fit: contain; flex: none; }
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .mob-brand { display: flex; } }
@media (min-width: 701px) { .mob-brand { display: none; } }

/* Settings page tabs */
.subnav { display: flex; gap: 4px; padding: 4px; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--muted); border-radius: 12px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { font: inherit; font-weight: 500; padding: 8px 16px; border: 0; border-radius: 9px; background: none; color: var(--muted-foreground); cursor: pointer; white-space: nowrap; }
.subnav button:hover { color: var(--foreground); }
.subnav button.active { background: var(--card); color: var(--foreground); box-shadow: 0 1px 3px rgb(0 0 0 / .15); }
@media (max-width: 700px) { .subnav { width: 100%; } .subnav button { flex: 1 1 auto; padding: 8px 10px; } }

.page-actions select { width: auto; height: 40px; padding: 0 12px; }

/* expenses + reports */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
label.inline { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.inline input, label.inline select { width: auto; margin: 0; }
#expenses .num { text-align: right; }
#expenses td.nowrap { white-space: nowrap; }
.stat.neg strong { color: var(--destructive); }
.chart rect.inc { fill: var(--primary); }
.chart rect.exp { fill: color-mix(in srgb, var(--destructive) 75%, transparent); }
.legend { display: flex; gap: 18px; margin-top: 10px; font-size: 13px; color: var(--muted-foreground); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend i.inc { background: var(--primary); }
.legend i.exp { background: color-mix(in srgb, var(--destructive) 75%, transparent); }
.bar-row.money { grid-template-columns: minmax(70px, 150px) 1fr auto; }
@media (max-width: 700px) {
  .toolbar label.inline { flex: 1 1 140px; }
  .toolbar label.inline input, .toolbar label.inline select { flex: 1; min-width: 0; }
  .toolbar .btn { flex: 1 1 auto; }
}

#expenses tbody tr[data-ex] { cursor: pointer; }
@media (max-width: 700px) { #expenses th:last-child, #expenses td:last-child { display: none; } }

/* Text block field (e.g. bank details) */
.field.content-block { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); gap: 6px; }
.content-title { font-size: 15px; }
.content-text { white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.6; }

.notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); font-size: 14px; }
.notice.warn { background: color-mix(in srgb, var(--destructive) 14%, transparent); border: 1px solid color-mix(in srgb, var(--destructive) 55%, transparent); }
