/* TheDayRate — page layout only. Components live in components.css,
   colours in tokens.css. Never write a raw colour here: use a token. */

/* Spacing scale, switched by Settings > Appearance > Spacing */
:root{--pad:22px;--gap:18px;--row:12px;--cell:14px}
html[data-density="compact"]{--pad:16px;--gap:12px;--row:8px;--cell:12px}
html[data-density="compact"] body{font-size:14.5px}

.app{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;overflow-y:auto}
.content{padding:30px 40px 64px;max-width:1280px;width:100%}
.content:focus{outline:none}
.below{margin-top:16px;text-align:center}

/* Home: what's owed and what to invoice lead; the tax year sits underneath
   as one quiet panel; activity last. Few boxes, hierarchy from type. */
.home-grid{display:grid;grid-template-columns:minmax(0,1.75fr) minmax(0,1fr);gap:var(--gap);align-items:stretch}
.home-grid > .setup,.home-grid > .year,.home-grid > .activity{grid-column:1 / -1}
.owed{display:flex;flex-direction:column;padding:26px 28px 18px}
.owed .big{margin:10px 0 4px}
.owed-list{margin-top:20px}
.owed-list li{border-top:1px solid var(--line)}
.owed-row{display:flex;align-items:center;gap:14px;padding:12px 8px;margin:0 -8px;border-radius:var(--radius-sm);color:inherit;text-decoration:none;}
@media (hover:hover) and (pointer:fine){.owed-row:hover{background:var(--bg)}}
.owed-text{flex:1;min-width:0;display:flex;flex-direction:column}
.owed-text b{font-weight:600}
.owed-text > span{font-size:13.5px;color:var(--text-muted)}
.owed-amount{font-weight:600;white-space:nowrap}
.card-more{display:inline-flex;align-items:center;gap:4px;align-self:flex-start;margin-top:auto;padding:12px 0 2px;color:var(--accent-hover);font-size:14px;font-weight:600;text-decoration:none}
.card-more .ph{font-size:14px}
.nw{white-space:nowrap}
.ready{display:flex;flex-direction:column;gap:4px;padding:26px 24px 24px}
.ready .amount{margin-top:10px}
.ready-list{margin:16px 0 20px}
.ready-list li{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.ready-list li > span:first-child{display:flex;flex-direction:column;min-width:0}
.ready-list b{font-weight:600}
.ready-list li > span:first-child span{font-size:13px;color:var(--text-muted)}
.ready-amount{font-weight:600;white-space:nowrap}
.ready .btn{margin-top:auto}
.pot-note{font-size:13.5px;color:var(--text-muted)}

/* The tax year: one panel, figures split by hairlines, then the months */
.year{padding:0}
.year-title{padding:var(--pad) var(--pad) 0}
.year .stats{margin:0;padding:0}
.year .stat{padding:14px var(--pad) var(--pad)}
.stats-1{grid-template-columns:minmax(0,1fr)}
.stats-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.stats-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.stats-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.chart{margin:0;padding:18px var(--pad) var(--pad);border-top:1px solid var(--line)}
.chart-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:16px}
.chart-title{font-size:14px;font-weight:600;color:var(--text-muted)}
.chart-note{font-size:13px;color:var(--text-muted)}
.chart-empty{margin-top:6px}
.chart-plot{position:relative;height:168px;padding-left:56px}
.chart-grid{position:absolute;inset:0 0 24px 0;display:flex;flex-direction:column;justify-content:space-between;pointer-events:none}
.chart-grid span{display:flex;align-items:center;gap:10px;width:100%;height:0;font-size:12px;color:var(--text-muted)}
.chart-grid span::after{content:"";flex:1;border-top:1px dashed var(--line)}
.chart-grid span:last-child::after{border-top-style:solid;border-color:var(--line-strong)}
.chart-cols{position:relative;display:grid;grid-template-columns:repeat(12,minmax(0,1fr));height:100%}
.chart-col{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;height:100%}
.chart-bar{position:relative;width:min(24px,62%);height:calc((100% - 24px) * var(--v));border-radius:1px 1px 0 0;background:var(--accent)}
.chart-col:not(.is-now) .chart-bar{background:color-mix(in srgb,var(--accent) 70%,var(--card))}
.chart-label{display:flex;align-items:center;justify-content:center;height:24px;font-size:12px;color:var(--text-muted)}
.chart-col.is-now .chart-label{color:var(--text);font-weight:600}
.chart-col.is-ahead .chart-label{color:var(--text-faint)}
.chart-label .l-short{display:none}
.chart-tip{position:absolute;bottom:calc(100% + 8px);left:50%;z-index:2;display:flex;flex-direction:column;align-items:center;padding:6px 10px;border-radius:var(--radius-sm);background:var(--text);color:var(--card);font-size:13px;font-weight:600;white-space:nowrap;opacity:0;transform:translateX(-50%);pointer-events:none}
.chart-tip span{font-size:11.5px;font-weight:500;opacity:.8}
@media (hover:hover) and (pointer:fine){.chart-col:hover .chart-tip{opacity:1;transform:translate(-50%,0)}}

.activity{grid-column:1 / -1}
.feed{margin-top:8px}
.feed li + li{border-top:1px solid var(--line)}
.feed-row{display:flex;align-items:center;gap:14px;padding:11px 8px;margin:0 -8px;border-radius:var(--radius-sm);color:inherit;text-decoration:none}
@media (hover:hover) and (pointer:fine){.feed-row:hover{background:var(--bg)}}
.feed-text{flex:1;min-width:0}
.feed-text b{font-weight:600}
.feed-text > span{display:block;font-size:13.5px;color:var(--text-muted)}
.feed-amount{font-weight:600;white-space:nowrap}
.feed-amount.in{color:var(--success)}
@media (max-width: 1100px){
  .home-grid{grid-template-columns:minmax(0,1fr)}
  .stats-3,.stats-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .year .stat:nth-child(odd){border-left:0}
  .year .stats-3 .stat:nth-child(n+3),.year .stats-4 .stat:nth-child(n+3){border-top:1px solid var(--line)}
}
@media (max-width: 760px){
  .page-actions .btn-icon-sm span{display:none}
  .page-actions .btn-icon-sm{width:44px;padding:0;flex:none}
  .owed{padding:22px 20px 14px}
  .ready{padding:22px 20px 20px}
  .chart-plot{padding-left:44px;height:150px}
  .chart-label .l-long{display:none}
  .chart-label .l-short{display:inline}
  /* Phones: the year's figures become rows, label left and figure right */
  .year .stats{grid-template-columns:minmax(0,1fr)}
  .year .stat{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:16px;align-items:baseline;padding:12px var(--pad);border-left:0}
  .year .stat + .stat{border-top:1px solid var(--line)}
  .year .stat-label{grid-column:1;grid-row:1}
  .year .stat-value{grid-column:2;grid-row:1;font-size:19px}
  .year .stat-note{grid-column:1 / -1}
  .year .stat .meter{grid-column:1 / -1;margin:8px 0 6px}
}

/* One invoice */
.invoice-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:var(--gap);align-items:start}
.invoice-layout .paper-wrap{max-width:820px}
.side{display:flex;flex-direction:column;gap:var(--gap);position:sticky;top:24px}
.stack-actions{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.stack-actions .btn{justify-content:flex-start}
.history{margin-top:10px}
.history li{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid var(--line);font-size:14px}
.history li:first-child{border-top:0}
.history li span:first-child{color:var(--text-muted)}

/* Invoice editor */
.editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.95fr);gap:24px;align-items:start}
.editor-form{padding:24px}
.editor-form > .grid-2,.editor-form > .field,#edShifts:not(:empty){margin-bottom:22px}
.preview{position:sticky;top:24px}
.preview-label{margin-bottom:10px;font-size:13.5px;font-weight:600;color:var(--text-muted)}
.preview .doc{padding:32px 34px 30px;font-size:12.5px}
.shift-picker{padding:14px 16px;border-radius:var(--radius-sm);background:var(--bg)}
.shift-picker legend{display:flex;align-items:center;gap:8px;float:left;width:100%;margin-bottom:8px}
.shift{display:flex;align-items:center;gap:12px;clear:both;padding:10px 0;border-top:1px solid var(--line);cursor:pointer}
.shift:first-of-type{border-top:0}
.shift-text{flex:1;min-width:0}
.shift-text b{font-weight:600}
.shift-text span{display:block;font-size:13px;color:var(--text-muted)}
.shift-amount{font-weight:600}
.lines-set{margin-bottom:22px}
#edLines{display:flex;flex-direction:column;gap:10px;margin-bottom:8px}
.line{padding:14px;border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--card)}
.line-top{display:grid;grid-template-columns:minmax(0,1fr) 160px 36px;gap:10px;align-items:end}
.line-bottom{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-end;margin-top:10px}
.line-rate{flex:1 1 240px}
.line-custom{flex:1 1 110px}
.line-unit{flex:1 1 104px}
.line-qty{flex:0 1 92px}
.line-amount{flex:0 0 auto;min-width:96px;margin-left:auto;display:flex;flex-direction:column;align-items:flex-end;justify-content:flex-end;min-height:42px}
.line-amount-label{font-size:12px;color:var(--text-muted)}
.line-amount b{font-size:16px}
.line-min{font-size:12px;color:var(--text-muted)}
.line-min:empty{display:none}
.line-remove{margin-bottom:3px}
.editor-total{display:flex;justify-content:space-between;align-items:baseline;padding-top:16px;border-top:1px solid var(--line);font-weight:600}
.editor-total b{font-size:26px;letter-spacing:-.02em}
.editor-total-right{display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.editor-vat{font-size:13px;font-weight:500;color:var(--text-muted)}
.editor-vat:empty{display:none}
.settings-link{margin-top:14px}
.settings-link a{color:var(--accent-hover);font-weight:600}

/* Tax */
.tax-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--gap)}
.span-all{grid-column:1 / -1}
.tax-hero .big{font-size:48px}
.sum-list{margin-top:18px}
.sum-list > div{display:flex;justify-content:space-between;padding:8px 0;border-top:1px solid var(--line)}
.sum-list dt{color:var(--text-muted)}
.sum-list .sum-total{border-top:1px solid var(--line-strong);font-weight:700}
.sum-list .sum-total dt{color:var(--text)}
.dates{margin-top:10px}
.dates li{display:flex;flex-direction:column;gap:2px;padding:10px 0;border-top:1px solid var(--line)}
.dates li:first-child{border-top:0}
.dates span{color:var(--text-muted);font-size:14px}
.tax-grid .card-title + .table,.tax-grid .card-title + .prose-sm{margin-top:10px}
.select-inline select{min-width:180px;font-weight:600}

/* Clients */
.client-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(310px,1fr));gap:var(--gap)}
.client-card{display:flex;flex-direction:column;gap:14px}
.client-card.is-archived{opacity:.7}
.client-top{display:flex;align-items:center;gap:12px}
.client-name{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:17px;font-weight:600}
.bands li{display:flex;justify-content:space-between;gap:12px;padding:7px 0;border-top:1px solid var(--line);font-size:14px}
.bands li:first-child{border-top:0}
.client-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:12px 14px;border-radius:var(--radius-sm);background:var(--bg)}
.client-stats dt{font-size:12.5px;color:var(--text-muted)}
.client-stats dd{font-weight:600}
.client-actions{display:flex;gap:8px;margin-top:auto}
.band-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) minmax(0,.9fr) minmax(0,.9fr) 36px;gap:10px;align-items:end;padding:12px 0;border-top:1px solid var(--line)}
.band-row:first-child{border-top:0}
.bands-set{margin-top:22px}
.bands-set .field-help{margin:-4px 0 6px}
.archive-check{margin-top:16px}
.own-settings{margin-top:22px;border:1px solid var(--line);border-radius:var(--radius-sm)}
.own-settings > summary{display:flex;flex-direction:column;gap:2px;padding:12px 14px;cursor:pointer;list-style:none}
.own-settings > summary::-webkit-details-marker{display:none}
.own-settings > summary b{font-size:13.5px;font-weight:600;display:flex;justify-content:space-between}
.own-settings > summary b::after{content:'Show';font-weight:500;color:var(--accent-hover)}
.own-settings[open] > summary b::after{content:'Hide'}
.own-settings > summary span{font-size:13px;color:var(--text-muted)}
.own-settings > summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:var(--radius-sm)}
.own-body{display:grid;gap:14px;padding:4px 14px 14px;border-top:1px solid var(--line);padding-top:14px}
.own-show legend{font-size:13.5px;font-weight:600}
.own-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,210px);gap:10px;align-items:center;padding:6px 0;font-size:14px}
.own-row + .own-row{border-top:1px solid var(--line)}
@media (max-width:560px){.own-row{grid-template-columns:1fr;gap:4px}}

/* Settings */
.settings{display:grid;grid-template-columns:190px minmax(0,1fr);gap:28px;align-items:start}
.settings-nav{position:sticky;top:24px;display:flex;flex-direction:column;gap:2px}
.settings-nav a{padding:8px 12px;border-radius:var(--radius-sm);color:var(--text-muted);font-weight:500;font-size:14.5px;text-decoration:none}
@media (hover:hover) and (pointer:fine){.settings-nav a:hover{background:var(--card);color:var(--text)}}
.settings-body{display:flex;flex-direction:column;gap:var(--gap);max-width:780px}
.settings-card{padding:24px;scroll-margin-top:20px}
.section-title{font-size:18px;font-weight:700;letter-spacing:-.01em}
.section-help{margin:4px 0 18px;color:var(--text-muted)}
.settings-card .setting + .setting{margin-top:22px}
.settings-card > .grid-2 + .switch-list,.settings-card > .grid-3 + .switch-list{margin-top:10px}
.settings-card > .switch-list + .field,.settings-card > .fieldset + .field{margin-top:16px}
.settings-card > .setting + .field{margin-top:16px}
.data-actions{display:flex;flex-wrap:wrap;gap:10px}

/* More (phones) */
.more-list{padding:4px 0}
.more-list a{display:flex;align-items:center;gap:14px;padding:16px 20px;color:var(--text);font-weight:600;text-decoration:none;border-top:1px solid var(--line)}
.more-list a:first-child{border-top:0}
.more-list a span{flex:1}
.more-list a .ph:last-child{color:var(--text-faint)}

/* ── Smaller screens ─────────────────────────────────────────────────── */
@media (max-width: 1180px){
  .editor{grid-template-columns:minmax(0,1fr)}
  .preview{position:static}
  .invoice-layout{grid-template-columns:minmax(0,1fr)}
  .side{position:static;order:-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width: 1100px){
  .settings{grid-template-columns:minmax(0,1fr)}
  .settings-nav{display:none}
}
@media (max-width: 760px){
  .app{grid-template-columns:minmax(0,1fr)}
  .sidebar{display:none}
  .content{padding:20px 16px calc(96px + env(safe-area-inset-bottom))}
  .tabbar{position:fixed;left:0;right:0;bottom:0;z-index:40;display:grid;grid-template-columns:repeat(5,1fr);padding:6px 4px calc(6px + env(safe-area-inset-bottom));background:var(--card);border-top:1px solid var(--line)}
  .tabbar a{display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0;border-radius:var(--radius-sm);color:var(--text-muted);font-size:11.5px;font-weight:600;text-decoration:none}
  .tabbar .ph{font-size:23px}
  .tabbar a[aria-current="page"]{color:var(--accent-hover)}
  .page-title{font-size:24px}
  .page-head{align-items:flex-start;flex-direction:column}
  .page-actions{width:100%}
  .page-actions .btn-primary{flex:1}
  .big{font-size:44px}
  .home-grid,.tax-grid{grid-template-columns:minmax(0,1fr)}
  .stats{grid-template-columns:repeat(2,minmax(0,1fr))}
  .stat:nth-child(odd){border-left:0}
  .stat:nth-child(n+3){border-top:1px solid var(--line)}
  .stat-wide{grid-column:1 / -1}
  .hide-sm{display:none}
  .show-sm{display:block}
  .table .show-sm.note{margin-top:2px}
  .table td .show-sm .tag{margin-top:4px}
  .segmented{display:flex;width:100%}
  .seg{flex:1;justify-content:center;padding:0 6px}
  .seg-count{display:none}
  .stack-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
  .stack-actions > :first-child{grid-column:1 / -1;justify-content:center}
  .stack-actions .btn{white-space:normal;text-align:left;line-height:1.25;padding:8px 12px}
  .preview .doc{padding:22px 16px}
  .doc-table{font-size:12px}
  .doc-table th{font-size:10.5px}
  .grid-2,.grid-3,.choices-2,.choices-3{grid-template-columns:minmax(0,1fr)}
  .search{flex:1 1 100%}
  .side{grid-template-columns:minmax(0,1fr)}
  .doc{padding:24px 18px;font-size:12.5px}
  .doc-head{flex-direction:column;gap:16px}
  .doc-title,.doc-meta dl > div{text-align:left;justify-content:flex-start}
  .doc-meta dd{text-align:left;min-width:0}
  .doc-table th:nth-child(4),.doc-table td:nth-child(4){display:none}
  .editor-form{padding:18px}
  .line-top{grid-template-columns:minmax(0,1fr) 36px}
  .line-date{grid-column:1;grid-row:2}
  .band-row{grid-template-columns:minmax(0,1fr) minmax(0,1fr);}
  .band-row .icon-btn{grid-column:2;justify-self:end}
  .dialog{width:100vw;max-width:100vw;max-height:92dvh;margin:auto 0 0;border-radius:var(--radius) var(--radius) 0 0}
  .dialog-form{max-height:92dvh}
  .toast{bottom:calc(84px + env(safe-area-inset-bottom))}
}

/* ── Printing an invoice: just the paper ─────────────────────────────── */
@media print{
  @page{size:A4;margin:14mm}
  html,body{background:var(--paper) !important}
  .sidebar,.tabbar,.page-head,.side,.toast,.skip,.dialog,.design-controls,.design-preview > :not(.paper-wrap){display:none !important}
  .design-layout{display:block}
  .app,.content,.invoice-layout{display:block;padding:0;margin:0;max-width:none}
  .doc{box-shadow:none;border:0;padding:0;font-size:11.5pt}
  .doc-stamp{display:none}
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
.section-title + .setting,.section-title + .grid-2,.section-title + .grid-3{margin-top:16px}
.hello{position:fixed;inset:0;z-index:100;display:grid;place-items:center;background:var(--bg)}
.hello img{max-width:100%;max-height:100dvh;object-fit:contain}

/* Settings: your account and invites */
.field-label{font-size:13.5px;font-weight:600;color:var(--text)}
input[readonly]{background:var(--bg);color:var(--text-muted)}
.sub-title{margin:24px 0 8px;font-size:15px;font-weight:600}
.sub-title .muted{margin-left:4px;font-weight:500}
.methods{display:flex;flex-direction:column}
.method{display:flex;align-items:center;gap:14px;padding:12px 0;border-top:1px solid var(--line)}
.method:first-child{border-top:0}
.method > .ph{font-size:20px;color:var(--text-muted)}
.method-text{flex:1;min-width:0;display:flex;flex-direction:column}
.method-text b{font-weight:600}
.method-text span{font-size:13.5px;color:var(--text-muted)}
.account-actions{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.invite-form{display:flex;gap:10px}
.invite-form input{flex:1}
.people-list li{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line);flex-wrap:wrap}
.people-list li:first-child{border-top:0}
.person-email{flex:1;min-width:180px;font-weight:500;word-break:break-all}
.person-status{font-size:13.5px}
.person-actions{display:flex;align-items:center;gap:4px}
@media (max-width: 760px){
  .invite-form{flex-direction:column}
  .method{flex-wrap:wrap}
  .method .btn{margin-left:34px}
}

/* Home: getting started, for a new account */
.setup{grid-column:1 / -1;padding:26px 28px}
.setup-title{font-size:20px;font-weight:700;letter-spacing:-.015em;margin-bottom:4px}
.steps{margin-top:16px}
.step{display:flex;align-items:center;gap:16px;padding:14px 0;border-top:1px solid var(--line)}
.step:first-child{border-top:0}
.step-mark{display:grid;place-items:center;width:30px;height:30px;flex:none;border-radius:50%;background:var(--ghost);color:var(--text-muted);font-weight:700;font-size:14px}
.step.is-done .step-mark{background:var(--success-soft);color:var(--success)}
.step-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.step-text b{font-weight:600}
.step-text span{font-size:14px;color:var(--text-muted)}
.step.is-done .step-text b{color:var(--text-muted);text-decoration:line-through}
.setup-foot{margin-top:14px;font-size:14px;color:var(--text-muted)}
@media (max-width: 760px){
  .setup{padding:20px}
  .step{flex-wrap:wrap}
  .step .btn{margin-left:46px}
}

/* Invoice design tab */
.design-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:24px;align-items:start}
.design-controls{display:flex;flex-direction:column;gap:var(--gap);min-width:0}
.design-row{margin-top:16px}
.design-fields{display:flex;flex-direction:column;gap:16px}
.logo-box{display:flex;align-items:flex-start;gap:18px;flex-wrap:wrap}
.logo-thumb{display:grid;place-items:center;width:150px;height:90px;flex:none;padding:10px;border:1px dashed var(--line-strong);border-radius:var(--radius-sm);background:var(--paper);color:var(--paper-muted);font-size:13px;text-align:center}
.logo-thumb img{max-width:100%;max-height:100%;object-fit:contain}
.logo-thumb .ph{font-size:22px;display:block;margin:0 auto 4px}
.logo-actions{display:flex;flex-direction:column;align-items:flex-start;gap:8px;flex:1;min-width:200px}
.seg-inline{display:flex;width:100%}
.seg-inline .seg{flex:1;justify-content:center;position:relative}
.seg-inline input{position:absolute;opacity:0;pointer-events:none}
.seg-inline .seg:has(input:checked){background:var(--card);color:var(--text);box-shadow:inset 0 0 0 1px var(--line-strong)}
.seg-inline .seg:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.font-choices .choice{align-items:flex-start}
.font-sample{display:block;width:100%;padding:10px 12px;border-radius:var(--radius-sm);background:var(--paper);color:var(--paper-text);font-size:15px;line-height:1.25;border:1px solid var(--paper-line)}
.swatch-custom input[type=color]{position:static;opacity:1;width:20px;height:20px;padding:0;border:0;border-radius:3px;background:none;cursor:pointer}
.swatch-custom input[type=color]::-webkit-color-swatch-wrapper{padding:0}
.swatch-custom input[type=color]::-webkit-color-swatch{border:0;border-radius:3px;box-shadow:inset 0 0 0 1px rgba(15,27,45,.12)}
.swatch-custom input[type=radio]{position:absolute;opacity:0}
.inline-field{padding:4px 0 14px}
.inline-field input{max-width:220px}
@media (max-width: 1180px){
  .design-layout{grid-template-columns:minmax(0,1fr)}
}
.section-title + .design-fields,.section-title + .choices,.section-title + .switch-list,.section-title + .logo-box{margin-top:16px}
.swatch-custom{white-space:nowrap}

/* Client logos: the client's own picture, small, on white so any logo reads */
.client-logo{width:28px;height:28px;flex:none;object-fit:contain;padding:2px;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff}
.client-cell .client-logo{width:22px;height:22px;padding:1px}
.client-top .client-logo{width:40px;height:40px;padding:3px}
.client-logo-row{display:flex;gap:16px;align-items:flex-start;margin-bottom:18px}
.client-logo-box{display:grid;place-items:center;width:64px;height:64px;flex:none;padding:4px;border:1px dashed var(--line-strong);border-radius:var(--radius-sm);background:#fff;color:var(--paper-muted)}
.client-logo-box img{width:100%;height:100%;object-fit:contain}
.client-logo-row .logo-actions{flex-direction:row;align-items:center;min-width:0;margin-top:8px}

/* Receipts on expenses */
.receipt-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.receipt-box{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;min-width:0}
.receipt-box:empty{display:none}
.receipt-name{display:inline-flex;align-items:center;gap:6px;max-width:260px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600;color:var(--text)}
a.receipt-name{color:var(--accent-hover)}
.has-receipt{margin-left:6px;color:var(--text-muted);vertical-align:-2px}
.has-receipt .ph{font-size:15px}

/* Diary and bank import */
.page-stack{display:flex;flex-direction:column;gap:var(--gap)}
.table .check-col{width:1%;padding-right:4px}
.ready-clients{display:flex;flex-direction:column;margin-top:8px}
.ready-clients li{display:flex;align-items:center;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.ready-clients li:first-child{border-top:0}
.ready-clients li > span{display:flex;flex-direction:column;flex:1;min-width:0}
.ready-clients li > span span{font-size:13.5px;color:var(--text-muted)}
.gig-pick select{min-width:170px;min-height:36px;padding-top:6px;padding-bottom:6px;font-size:14px}
.gig-pick select + select{margin-top:6px}
.gig-status{font-size:14px;white-space:nowrap}
.gig-status a{font-weight:600}
.quiet-link{display:block;margin-top:2px;color:var(--text-muted);font-weight:500;font-size:13px}
.is-ignored td{color:var(--text-faint)}
.is-ignored b{font-weight:500}
.pad-note{padding:0 var(--pad) 12px;font-size:14px;color:var(--text-muted)}
.card-foot{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;padding:14px var(--pad);border-top:1px solid var(--line)}
.card-foot .field-error{margin-right:auto}
.how-list{display:flex;flex-direction:column;margin:14px 0 18px;border:1px solid var(--line);border-radius:var(--radius-sm)}
.how + .how{border-top:1px solid var(--line)}
.how summary{display:flex;justify-content:space-between;padding:11px 14px;font-weight:600;cursor:pointer;list-style:none}
.how summary::-webkit-details-marker{display:none}
.how summary::after{content:'How';font-weight:500;color:var(--accent-hover)}
.how[open] summary::after{content:'Hide'}
.how summary:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
.diary-table table{table-layout:fixed;min-width:680px}
.diary-table th:nth-child(1){width:128px}
.diary-table th:nth-child(3){width:30%}
.diary-table th:nth-child(4){width:96px}
.diary-table th:nth-child(5){width:150px}
.diary-table .gig-pick select{width:100%;min-width:0}
.how ol{margin:0;padding:0 14px 14px 34px;list-style:decimal;color:var(--text-muted);font-size:14px;display:flex;flex-direction:column;gap:4px}
.cal-form .form-actions{margin-top:4px;align-items:center}
.cal-list{display:flex;flex-direction:column;margin:6px 0 10px}
.cal-list li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line)}
.cal-list li:first-child{border-top:0}
.cal-list li > span{display:flex;flex-direction:column}
.receipt-thumb{width:40px;height:40px;flex:none;object-fit:cover;border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff}

/* On a phone, these tables become one block per row instead of scrolling sideways */
@media (max-width:760px){
  .table.stack-sm{min-width:0;table-layout:auto}
  .stack-sm thead{display:none}
  .stack-sm,.stack-sm tbody{display:block}
  .stack-sm tr{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px 12px;align-items:center;padding:12px var(--pad);border-bottom:1px solid var(--line)}
  .stack-sm.gigs tr{grid-template-columns:minmax(0,1fr)}
  .stack-sm tbody tr:last-child{border-bottom:0}
  .stack-sm td{display:block;padding:0 !important;border:0 !important;width:auto !important}
  .stack-sm td.wide-sm{grid-column:1 / -1}
  .stack-sm td.hide-sm{display:none}
  .stack-sm .client-cell:empty,.stack-sm td:empty{display:none}
  .stack-sm td.check-col{width:auto}
  .stack-sm .gig-pick select{min-width:0}
  .note > .show-sm{display:inline}
}
