/* Legends Connect: Stanley Apps family look. Inter, navy + indigo, light surfaces, hairline structure. */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-latin-wght.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --h: #0B1F4D; --ht: #fff; --a: #4F46E5; --at: #fff;
  --navy: #0B1F4D; --indigo: #4F46E5; --violet: #7C3AED;
  --bg: #F6F8FC; --card: #fff; --text: #16203A; --muted: #5E6B85; --line: #E3E8F2; --soft: #EEF1F8;
  --tint: color-mix(in srgb, var(--a) 10%, transparent);
  --danger: #D1343E; --warn: #B45309; --ok: #15803D;
  --r-lg: 18px; --r: 14px; --r-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 48, .04), 0 2px 8px rgba(16, 24, 48, .04);
  --shadow-lift: 0 10px 30px rgba(16, 24, 48, .12);
  --nav-h: 68px; --top-h: 60px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
h1, h2, h3, .brand { font-family: var(--font); letter-spacing: -0.022em; line-height: 1.15; }
h1 { font-size: 1.75rem; font-weight: 750; margin: .25rem 0 1rem; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 1.6rem 0 .7rem; }
h3 { font-size: 1rem; font-weight: 650; margin: .9rem 0 .4rem; }
a { color: var(--a); text-decoration: none; } a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; } .right { text-align: right; }
.ok { color: var(--ok); } .danger { color: var(--danger); } .warn { color: var(--warn); }
::selection { background: color-mix(in srgb, var(--a) 22%, transparent); }

/* ---------- App frame ---------- */
#top { position: sticky; top: 0; z-index: 30; height: calc(var(--top-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; display: flex; align-items: center; gap: 10px;
  background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); color: var(--text); }
#top .logo { height: 34px; max-width: 120px; object-fit: contain; border-radius: 8px; }
#top .logo.box { background: #fff; padding: 3px; border: 1px solid var(--line); }
#top .brand { font-weight: 700; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
#top .icon-btn { color: var(--text); }
#top [data-act="new-job"] { background: var(--a); color: var(--at); border-radius: 12px; width: 42px; min-width: 42px; height: 42px; min-height: 42px; font-size: 1.4rem; }
#main { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 96px + env(safe-area-inset-bottom)); }

/* phone: floating pill menu */
#nav { position: fixed; z-index: 30; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); height: var(--nav-h); display: flex; padding: 6px;
  background: color-mix(in srgb, var(--card) 90%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lift); }
#nav a { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 16px; font-size: .7rem; font-weight: 600; color: var(--muted); position: relative; text-decoration: none; }
#nav a .ico svg { width: 23px; height: 23px; display: block; }
#nav a.on { color: var(--a); background: var(--tint); }
#nav .badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff; border-radius: 10px; font-size: .66rem; font-weight: 700; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }
@media (max-width: 899px) { #nav a.wide-only { display: none; } }

/* computer: navy sidebar with the one gradient in the app */
@media (min-width: 900px) {
  body.authed { padding-left: 248px; }
  #nav { top: 0; bottom: 0; left: 0; right: auto; width: 248px; height: auto; flex-direction: column; gap: 2px; padding: 84px 14px 20px; border-radius: 0; border: 0; box-shadow: none;
    background: radial-gradient(120% 60% at 0% 0%, rgba(124, 58, 237, .35), transparent 60%), linear-gradient(180deg, #0B1F4D 0%, #111A5C 100%); backdrop-filter: none; }
  #nav::before { content: 'Legends Connect'; position: absolute; top: 24px; left: 26px; color: #fff; font-weight: 750; font-size: 1.15rem; letter-spacing: -0.02em; }
  #nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 14px; min-height: 46px; font-size: .95rem; color: rgba(255, 255, 255, .72); border-radius: 12px; }
  #nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }
  #nav a.on { color: #fff; background: rgba(255, 255, 255, .12); }
  #nav a .ico svg { width: 20px; height: 20px; }
  #nav .badge { position: static; margin-left: auto; }
  #top { padding-left: 28px; }
  #main { padding: 28px 36px 60px; }
}

/* ---------- Surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card.tight { padding: 12px 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); } }

/* lists: one card, rows split by hairlines */
.list { list-style: none; margin: 0 0 14px; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.list > li + li { border-top: 1px solid var(--line); }
.list > li > a, .list > li > .li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; min-height: 64px; color: var(--text); text-decoration: none; }
.list > li > a:hover { background: var(--soft); text-decoration: none; }
.list > li > a > span:last-child:not(.pill) { color: var(--muted); font-size: 1.2rem; }
.list .grow { flex: 1; min-width: 0; } .list .t { font-weight: 600; } .list .s { color: var(--muted); font-size: .875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.list > li.empty, .empty { text-align: center; color: var(--muted); padding: 36px 16px; }

/* ---------- Controls ---------- */
.btn { appearance: none; border: 1px solid transparent; border-radius: 12px; min-height: 46px; padding: 10px 18px; font-weight: 600; font-size: .95rem; cursor: pointer; background: var(--a); color: var(--at); display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none !important; touch-action: manipulation; transition: background .15s, box-shadow .15s, transform .05s; box-shadow: 0 1px 2px rgba(16, 24, 48, .12); }
.btn:hover { filter: brightness(1.05); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--a); color: var(--at); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { background: var(--soft); filter: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .875rem; border-radius: 10px; }
.btn.big { min-height: 56px; font-size: 1.02rem; width: 100%; border-radius: 14px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { appearance: none; background: transparent; border: 0; min-width: 44px; min-height: 44px; border-radius: 12px; cursor: pointer; font-size: 1.15rem; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.icon-btn:hover { background: var(--soft); color: var(--text); }
label { display: block; font-weight: 600; font-size: .875rem; margin: 14px 0 6px; color: var(--text); }
label.inline { display: flex; gap: 10px; align-items: center; font-weight: 500; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=time], input[type=search], input[type=url], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid #D5DCE8; border-radius: 12px; background: var(--card); margin-top: 2px; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--a) 18%, transparent); }
.btn:focus-visible, a:focus-visible, .icon-btn:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--a) 55%, transparent); outline-offset: 2px; }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--a); flex: none; }
input[type=color] { width: 54px; height: 46px; border: 1px solid #D5DCE8; border-radius: 12px; padding: 4px; background: var(--card); }
.seg { display: flex; background: var(--soft); border-radius: 13px; padding: 4px; gap: 4px; overflow-x: auto; }
.seg button { flex: 1 0 auto; border: 0; background: transparent; min-height: 38px; border-radius: 10px; padding: 0 16px; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--muted); white-space: nowrap; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 48, .12); }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 2px; scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: .9rem; color: var(--muted); min-height: 40px; display: inline-flex; align-items: center; text-decoration: none; }
.tabs a.on { background: var(--text); border-color: var(--text); color: var(--card); }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 10px; font-size: .75rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.pill.booked, .pill.sent { background: #EAF0FF; color: #2F4BC9; } .pill.on_way { background: #FFF4DB; color: #8A5A00; } .pill.arrived { background: #E7F6EC; color: #1B6B35; }
.pill.done, .pill.paid, .pill.accepted { background: #E3F5E9; color: #146C33; } .pill.cancelled, .pill.void { background: #F1F3F7; color: #7A859B; } .pill.cancelled { text-decoration: line-through; }
.pill.draft { background: #F1F3F7; color: #4A5672; } .pill.overdue, .pill.declined { background: #FDE8EA; color: #A61B26; }
.notice { border-radius: var(--r); padding: 12px 16px; margin-bottom: 14px; background: #FFF8E6; color: #6B4700; border: 1px solid #FBE3A8; font-size: .92rem; }
.notice.bad { background: #FDECEE; color: #8B1C25; border-color: #F6C3C8; }
.notice.good { background: #EEF2FF; color: #2E3A8C; border-color: #D7DDFB; }
.notice .btn { margin-left: 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; } table.t th, table.t td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; } table.t th { font-size: .78rem; font-weight: 600; color: var(--muted); }
table.t tr:last-child td { border-bottom: 0; }
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 14px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi .n { font-size: 1.6rem; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; } .kpi .l { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.swatch { border: 2px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; background: var(--card); padding: 0; text-align: left; }
.swatch.on { border-color: var(--a); box-shadow: 0 0 0 4px var(--tint); }
.swatch .bar { height: 34px; } .swatch .acc { height: 6px; } .swatch .name { padding: 10px; font-weight: 600; font-size: .88rem; }

/* ---------- Toast, bars, sheets ---------- */
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 26px + env(safe-area-inset-bottom)); z-index: 100; background: #16203A; color: #fff; padding: 12px 18px; border-radius: 14px; max-width: 92vw; box-shadow: var(--shadow-lift); font-weight: 600; font-size: .92rem; }
#toast.bad { background: var(--danger); }
@media (min-width: 900px) { #toast { bottom: 28px; } }
#queuebar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top)); z-index: 25; background: #FFF4DB; color: #6B4700; text-align: center; padding: 8px; font-weight: 600; font-size: .88rem; border-bottom: 1px solid #FBE3A8; }
.sheet-wrap { position: fixed; inset: 0; z-index: 60; background: rgba(11, 18, 40, .45); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; max-height: 92vh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; box-shadow: var(--shadow-lift); animation: rise .2s cubic-bezier(.2, .8, .2, 1); }
.sheet::before { content: ''; display: block; width: 40px; height: 5px; border-radius: 3px; background: #CBD3E1; margin: 0 auto 8px; }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; max-height: 88vh; padding-top: 18px; } .sheet::before { display: none; } }
.sheet-head { display: flex; align-items: center; gap: 8px; position: sticky; top: -10px; background: var(--bg); padding: 6px 0 10px; z-index: 2; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.25rem; }
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet, .sheet-wrap { animation: none; } }

/* ---------- Login and sign up: split screen like Legends Transport ---------- */
body:not(.authed) #main { max-width: none; padding: 0; }
.auth-split { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-brand { display: none; position: relative; overflow: hidden; color: #fff; padding: 56px; align-items: flex-end;
  background: radial-gradient(90% 70% at 10% 10%, rgba(124, 58, 237, .55), transparent 60%), radial-gradient(70% 60% at 90% 90%, rgba(79, 70, 229, .5), transparent 60%), #0B1F4D; }
.auth-brand .wordmark { width: 280px; max-width: 100%; height: auto; display: block; }
.auth-brand h2 { font-size: 2.6rem; font-weight: 750; letter-spacing: -0.035em; line-height: 1.05; margin: 22px 0 14px; max-width: 12ch; }
.auth-brand p { color: rgba(255, 255, 255, .78); max-width: 38ch; font-size: 1.02rem; margin: 0; }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: rgba(255, 255, 255, .88); font-size: .95rem; }
.auth-brand li::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #A5B4FC; margin-right: 10px; vertical-align: middle; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-form > div { width: 100%; max-width: 400px; }
.auth-form .mini { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 28px; }
.auth-form .mini img { height: 34px; width: auto; }
.auth-form h1 { font-size: 1.9rem; margin: 0 0 6px; }
.auth-form .lead { color: var(--muted); margin: 0 0 18px; }
.auth-form form { margin: 0; }
.auth-form .alt { text-align: center; margin-top: 18px; color: var(--muted); font-size: .92rem; }
@media (min-width: 900px) { .auth-split { grid-template-columns: 1.05fr 1fr; } .auth-brand { display: flex; } .auth-form .mini { display: none; } }

/* ---------- Diary ---------- */
.diary-bar { display: flex; gap: 6px; align-items: center; margin-bottom: 14px; }
.diary-bar .date { font-weight: 750; font-size: 1.35rem; letter-spacing: -0.025em; flex: 1; min-width: 0; }
.job { display: grid; grid-template-columns: 58px 1fr auto; gap: 2px 12px; align-items: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-x pan-y; position: relative; }
.job::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--jc, var(--a)); }
.job .jt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; grid-row: span 2; padding-top: 1px; }
.job .jt small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; }
.job .t { font-weight: 600; } .job .s { color: var(--muted); font-size: .86rem; grid-column: 2; }
.job:hover { border-color: #CBD3E1; }
.job.cancelled { opacity: .55; } .job.done { opacity: .78; }
.job.late { border-color: #F2B8BD; box-shadow: 0 0 0 3px #FDE8EA; }
.job.lifted { opacity: .3; }
.problems { border-color: #FBE3A8; background: #FFFBF0; }
.problems summary { list-style: none; } .problems summary::-webkit-details-marker { display: none; }
.problems h3 { margin: 0; font-size: .98rem; color: #8A5A00; }
.problems li { margin: 6px 0; } .problems a { color: #6B4700; }
.week { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.week .col { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 180px; }
.week .col.today { border-color: var(--a); box-shadow: 0 0 0 3px var(--tint); }
.week .col h4 { margin: 0 0 8px; font-size: .85rem; font-weight: 650; } .week .col h4 a { color: var(--text); }
.week .job { grid-template-columns: 1fr; padding: 8px 10px 8px 12px; font-size: .85rem; box-shadow: none; background: var(--soft); border-color: transparent; }
.week .job .jt { grid-row: auto; font-size: .8rem; } .week .job .s { grid-column: 1; }
.grid-wrap { overflow: auto; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); max-height: 70vh; position: relative; -webkit-overflow-scrolling: touch; }
.sgrid { position: relative; }
.sgrid .hours { display: flex; position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); margin-left: 128px; }
.sgrid .hours div { flex: none; font-size: .74rem; color: var(--muted); padding: 8px 6px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.sgrid .srow { display: flex; border-bottom: 1px solid var(--line); min-height: 68px; } .sgrid .srow:last-child { border-bottom: 0; }
.sgrid .who { position: sticky; left: 0; z-index: 2; width: 128px; flex: none; background: var(--card); padding: 10px 12px; font-weight: 600; font-size: .88rem; border-right: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.sgrid .lane { position: relative; flex: none; background-image: linear-gradient(to right, var(--line) 1px, transparent 1px); }
.sgrid .lane.off { background: repeating-linear-gradient(45deg, var(--soft) 0 6px, transparent 6px 12px); }
.sgrid .blk { position: absolute; top: 8px; bottom: 8px; border-radius: 10px; padding: 6px 8px; font-size: .76rem; overflow: hidden; background: color-mix(in srgb, var(--jc, var(--a)) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--jc, var(--a)) 45%, transparent); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; line-height: 1.25; color: var(--text); }
.sgrid .blk b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 650; }
.sgrid, .week { user-select: none; -webkit-user-select: none; }
.drop-on { outline: 2px dashed var(--a); outline-offset: -3px; background-color: var(--tint) !important; }
.drag-ghost { position: fixed; z-index: 200; pointer-events: none; opacity: .92; box-shadow: var(--shadow-lift); max-width: 260px; }
.nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 1; pointer-events: none; }

/* worker buttons and job details */
.actions { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 14px 0; }
.check { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; margin: 0; } .check:last-child { border-bottom: 0; }
.photos { display: flex; gap: 8px; flex-wrap: wrap; } .photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; }
canvas.sign { width: 100%; height: 180px; background: #fff; border: 1.5px dashed #CBD3E1; border-radius: 14px; touch-action: none; }

/* inbox */
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); border: 1px solid var(--line); white-space: pre-wrap; word-wrap: break-word; }
.bubble.business { align-self: flex-end; background: var(--a); color: var(--at); border-color: transparent; border-radius: 18px 18px 6px 18px; }
.bubble .meta { font-size: .72rem; opacity: .7; margin-top: 4px; }

/* support view banner */
#support-bar { position: sticky; top: 0; z-index: 35; background: linear-gradient(90deg, #4F46E5, #7C3AED); color: #fff; padding: 8px 12px; text-align: center; font-size: .88rem; }
#support-bar .btn { min-height: 32px; margin-left: 8px; background: #fff; color: #4F46E5; }

/* ---------- Printable invoice / quote ---------- */
.doc { background: #fff; color: #16203A; max-width: 800px; margin: 0 auto; padding: 40px; border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 14.5px; }
.doc .dh { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid #E3E8F2; }
.doc .dh img { max-height: 64px; max-width: 200px; margin-bottom: 8px; }
.doc h1 { margin: 0; font-size: 1.9rem; color: var(--dh, #0B1F4D); }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; } .doc th { font-size: .78rem; color: #5E6B85; font-weight: 600; } .doc th, .doc td { padding: 10px 6px; border-bottom: 1px solid #E3E8F2; text-align: left; } .doc td.n, .doc th.n { text-align: right; font-variant-numeric: tabular-nums; }
.doc .tot { margin-left: auto; width: 280px; } .doc .tot td { border: 0; padding: 4px 6px; } .doc .tot tr.big td { font-size: 1.2rem; font-weight: 750; border-top: 2px solid #16203A; padding-top: 10px; }
@page { size: A4; margin: 14mm; }
@media print {
  body { background: #fff !important; padding: 0 !important; }
  #top, #nav, #hb-btn, #hb, #support-bar, #toast, #queuebar, .no-print { display: none !important; }
  #main { padding: 0 !important; max-width: none; }
  .doc { box-shadow: none; border: 0; padding: 0; max-width: none; }
}

/* week, days going down */
.week-down { display: grid; gap: 12px; }
.wd-day { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow); }
.wd-day.today { border-color: var(--a); box-shadow: 0 0 0 3px var(--tint); }
.wd-day header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 4px 10px; }
.wd-day header a { color: var(--text); }
.wd-day .job { box-shadow: none; background: var(--soft); border-color: transparent; }
.wd-day .job:last-child { margin-bottom: 0; }
/* month */
.month { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.month .mh { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.month .mh div { padding: 8px; font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; }
.month .mg { display: grid; grid-template-columns: repeat(7, 1fr); }
.month .mc { min-height: 112px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; gap: 3px; }
.month .mc:nth-child(7n) { border-right: 0; }
.month .mc:hover { background: var(--soft); }
.month .mc.other { background: color-mix(in srgb, var(--soft) 55%, transparent); } .month .mc.other .mn { color: #A3ADC2; }
.month .mn { font-size: .82rem; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.month .mc.today .mn { color: var(--at); } .month .mc.today .mn::before { content: ''; }
.month .mc.today .mn { background: var(--a); border-radius: 999px; padding: 1px 8px; align-self: flex-start; }
.month .moff { font-size: .62rem; font-weight: 600; color: var(--warn); background: #FFF4DB; border-radius: 6px; padding: 0 5px; }
.month .mj { font-size: .72rem; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: color-mix(in srgb, var(--jc) 13%, var(--card)); border-left: 3px solid var(--jc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; -webkit-user-select: none; }
.month .mj span { font-weight: 650; font-variant-numeric: tabular-nums; }
.month .mmore { font-size: .7rem; color: var(--muted); padding-left: 4px; }
.month .mdots { display: none; gap: 3px; flex-wrap: wrap; } .month .mdots i { width: 7px; height: 7px; border-radius: 50%; display: block; }
@media (max-width: 699px) {
  .month .mc { min-height: 64px; padding: 5px 3px; align-items: center; }
  .month .mj, .month .mmore { display: none; }
  .month .mdots { display: flex; justify-content: center; }
}
.linkish{background:none;border:0;padding:0;font:inherit;color:inherit;cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}
.linkish:focus-visible{outline:2px solid var(--accent,#4F46E5);outline-offset:2px;border-radius:4px}
