:root {
  color-scheme: light;
  font-family: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  --ink: #1e2333;
  --muted: #5c6373;
  --background: #f8f7f3;
  --surface: #fff;
  --line: #e9e7e0;
  --line-strong: #d8d9e1;
  --brand: #2e45c6;
  --brand-hover: #2338ad;
  --brand-soft: #ecf0ff;
  --nav-ink: #46516a;
  --success: #236448;
  --success-soft: #e8f6ed;
  --warning: #855305;
  --warning-soft: #fff2d9;
  --danger: #9d3039;
  --danger-soft: #fff0ef;
  --radius: 16px;
  --sidebar-width: 238px;
  --shadow: 0 4px 12px #20273b06, 0 1px 2px #20273b07;
  --ease: 160ms ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 280px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--background);
  font-size: 0.9375rem;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

[dir="rtl"] {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  letter-spacing: normal;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: var(--brand); text-underline-offset: .2em; }
img, svg { display: block; max-width: 100%; }
button svg, a svg { flex: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
[hidden] { display: none !important; }

h1, h2, h3, p { margin-block: 0; }
h1, h2, h3 { line-height: 1.18; }
h1, h2 { letter-spacing: -.042em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 750; }
h2 { font-size: clamp(1.3rem, 3vw, 1.65rem); font-weight: 730; }
h3 { font-size: 1.02rem; font-weight: 700; }
small { font-size: .8125rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.shell { min-height: 100vh; min-height: 100dvh; }
.main, .content { min-width: 0; }
.sidebar { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  border-block-end: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.28rem;
  font-weight: 790;
  line-height: 1;
  letter-spacing: -.055em;
  white-space: nowrap;
}

.brand-mark, .brand-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--brand);
  color: white;
  box-shadow: inset 0 1px 0 #ffffff33;
}

.brand-mark svg, .brand-icon svg { width: 22px; height: 22px; }
.brand > img { width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px; }
.brand strong { direction: ltr; unicode-bidi: isolate; }
.brand strong > span { color: var(--brand); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-context { display: none; }
.topbar-date { display: none; color: var(--muted); font-size: .86rem; }

.content {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) calc(90px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}

.content > * + *, .flow > * + * { margin-block-start: 18px; }
.content > section + section { margin-block-start: 26px; }
.section > * + * { margin-block-start: 12px; }

.bottom-nav {
  position: fixed;
  z-index: 10;
  inset-inline: 0;
  inset-block-end: 0;
  display: flex;
  justify-content: space-around;
  gap: 2px;
  padding: 5px max(6px, env(safe-area-inset-right, 0px)) calc(4px + env(safe-area-inset-bottom, 0px)) max(6px, env(safe-area-inset-left, 0px));
  border-block-start: 1px solid var(--line);
  background: #fffffff5;
  box-shadow: 0 -3px 18px #232a4210;
  backdrop-filter: blur(14px);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--nav-ink);
  text-align: start;
  text-decoration: none;
  font-weight: 620;
  transition: background var(--ease), color var(--ease);
}

.nav-item svg { width: 20px; height: 20px; }
.nav-item:is(:hover, [aria-current="page"], .is-active, .active) { background: var(--brand-soft); color: var(--brand); }

.bottom-nav .nav-item {
  flex: 1 1 0;
  min-width: 0;
  min-height: 50px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 4px 2px;
  font-size: .6875rem;
  line-height: 1.2;
  text-align: center;
  overflow-wrap: anywhere;
}

.view-heading, .section-heading, .sheet-header, .sheet-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.view-heading > *, .section-heading > *, .job-main > * { min-width: 0; }
.view-heading p, .section-heading p { margin-block-start: 5px; color: var(--muted); }
.view-heading h1, .section-heading h2, .job-card h3 { overflow-wrap: anywhere; }
.section-heading { margin-block-end: 12px; }
.eyebrow, .hero-kicker {
  font-size: .76rem;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .095em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  gap: 18px;
  min-height: 178px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid #2e45c6;
  border-radius: 20px;
  background: linear-gradient(112deg, #2035a1, #2f47ca 62%, #394fd0);
  color: #fff;
  box-shadow: 0 8px 22px #2339ab21;
}

.hero-content, .hero > :not(.hero-art) { position: relative; z-index: 1; }
.hero-content > * + * { margin-block-start: 8px; }
.hero :is(.hero-kicker, p, small, .muted) { color: #e5eaff; }
.hero h1 { font-size: clamp(2rem, 6.3vw, 3.4rem); }
.hero h2 { font-size: clamp(1.7rem, 4.4vw, 2.6rem); }
.hero .actions { margin-block-start: 16px; }
.hero .button.primary { border-color: #fff; background: #fff; color: #263ab3; }
.hero .button.primary:hover { background: #edf0ff; }
.hero .button.secondary { border-color: #c0cbff66; background: #ffffff17; color: #fff; }
.hero .button.secondary:hover { background: #ffffff2c; }
.hero .button.quiet { color: #fff; }
.hero :focus-visible { outline-color: #fff; }

.hero-art {
  position: absolute;
  z-index: 0;
  inset-inline-end: -80px;
  inset-block-start: 50%;
  width: 306px;
  height: 210px;
  opacity: .54;
  transform: translateY(-51%);
  pointer-events: none;
}

[dir="rtl"] .hero-art { transform: translateY(-51%) scaleX(-1); }

.hero-art > span {
  position: absolute;
  display: block;
}

.hero-art > span:nth-child(1) {
  inset: 25px -38px auto auto;
  width: 260px;
  height: 68px;
  border-radius: 34px 0 0 34px;
  background: repeating-linear-gradient(0deg, #d8e0ff0a 0 1px, transparent 1px 5px), linear-gradient(90deg, #afbeff44, #afbeff07);
  transform: rotate(-24deg);
}

.hero-art > span:nth-child(2) {
  inset: 53px auto auto 69px;
  width: 111px;
  height: 49px;
  border: 1px solid #d4deff77;
  border-radius: 16px;
  background: repeating-linear-gradient(0deg, #d8e0ff17 0 1px, transparent 1px 5px), linear-gradient(115deg, #b2c2ff8c, #c6d2ff55);
  box-shadow: inset 0 -5px 13px #17389f35;
  transform: rotate(-24deg);
}

.hero-art > span:nth-child(3) {
  inset: 92px auto auto 91px;
  width: 57px;
  height: 44px;
  border: solid #d4deff75;
  border-width: 0 0 4px 4px;
  border-radius: 0 0 0 12px;
  transform: rotate(-24deg);
}

.hero-art > span:nth-child(3)::after {
  position: absolute;
  content: "";
  inset: 36px auto auto 45px;
  width: 14px;
  height: 44px;
  border: 1px solid #d4deff75;
  border-radius: 7px;
  background: #a3b8ff8c;
}

.hero-stats { display: flex; flex-wrap: wrap; gap: 12px 20px; }

.card, .calendar, .empty, .stat, .list-item, .summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.card, .calendar, .summary-card { padding: 16px; }
.card > * + *, .calendar > * + *, .summary-card > * + * { margin-block-start: 12px; }
.grid, .stats-grid, .job-list, .list, .shortcut-grid { display: grid; gap: 10px; }
.grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); }
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); }
.shortcut-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 136px), 1fr)); }
.shortcut-grid > .button { justify-content: flex-start; min-height: 52px; }
.stat { padding: 14px; }
.stat { display: flex; align-items: flex-start; gap: 11px; }
.stat > div { min-width: 0; }
.stat-icon { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 9px; background: var(--brand-soft); }
.stat-icon svg { width: 17px; height: 17px; color: var(--brand); }
.stat :is(strong, .stat-value) { display: block; font-size: clamp(1.3rem, 4vw, 1.85rem); font-weight: 750; letter-spacing: -.04em; overflow-wrap: anywhere; }
.stat :is(span, p, small, .stat-label) { color: var(--muted); font-size: .82rem; line-height: 1.28; }
.muted { color: var(--muted); }
.text-link { display: inline-flex; min-height: 40px; align-items: center; gap: 5px; padding: 0; border: 0; background: transparent; color: var(--brand); font-weight: 680; text-underline-offset: .2em; }
.text-link:is(:hover, :focus-visible) { text-decoration: underline; }
.text-link svg { width: 17px; height: 17px; }

.calendar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.month-control { width: auto; min-width: 0; }
.month-control :is(select, input) { width: auto; }
.month-picker .month-control { flex: 1 1 110px; }
.month-picker .month-control :is(select, input) { width: 100%; max-width: none; }
.month-picker .month-control:has(input) { flex-grow: 0; }

.week, .month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(2px, 1vw, 7px);
}

.month-weekday { padding-block: 5px; overflow: hidden; color: var(--muted); font-size: clamp(.61rem, 2.6vw, .76rem); text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.month-grid .month-cell { min-height: 46px; }
.month-grid .month-cell.outside:not([aria-pressed="true"]) { background: #f9f9fa; color: var(--muted); }
.month-grid .month-cell.outside:is(:hover, :focus-visible) { background: var(--brand-soft); }

.day {
  display: flex;
  min-width: 0;
  min-height: 63px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  padding: 4px 1px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: #f5f5f7;
  color: var(--ink);
  line-height: 1.2;
  transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.day:hover { border-color: #aab7fa; background: var(--brand-soft); }
.day:is(.is-today, [aria-current="date"]) { border-color: #aab7fa; }
.day:is(.is-active, .active, [aria-pressed="true"]) { border-color: var(--brand); background: var(--brand); color: #fff; }
.day-label { max-width: 100%; overflow: hidden; color: var(--muted); font-size: clamp(.61rem, 2.6vw, .77rem); text-overflow: ellipsis; white-space: nowrap; }
.day:is(.is-active, .active, [aria-pressed="true"]) .day-label { color: #e4eaff; }
.day-number { font-size: clamp(.92rem, 3.8vw, 1.2rem); font-weight: 750; font-variant-numeric: tabular-nums; }
.day-dots { display: flex; max-width: 100%; min-height: 5px; gap: 2px; overflow: hidden; }
.day-dots > span, .dot { display: inline-block; flex: 0 0 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent, var(--brand)); }
.day:is(.is-active, .active, [aria-pressed="true"]) .day-dots > span { outline: 1px solid #fff9; outline-offset: -1px; }

.job-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  padding-inline-start: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.job-card::before { position: absolute; content: ""; inset: 0 auto 0 0; width: 4px; background: var(--accent, var(--brand)); }
[dir="rtl"] .job-card::before { inset: 0 0 0 auto; }
.job-card > * + * { margin-block-start: 0; }
.job-main, .job-footer, .list-item, .card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.job-main, .job-footer, .list-item, .card-header { flex-wrap: wrap; }
.job-main p, .list-item p { margin-block-start: 3px; color: var(--muted); }
.job-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; color: var(--muted); font-size: .85rem; }
.job-meta > span { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.job-meta svg, .list-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.job-footer { padding-block-start: 10px; border-block-start: 1px solid var(--line); }
.job-footer:empty { display: none; }
.job-footer > .actions { margin-inline-start: auto; }
.list-item { padding: 13px 14px; }
.list-item strong { overflow-wrap: anywhere; }
.list.card { gap: 0; padding: 0; overflow: hidden; }
.list.card .list-item { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.list.card .list-item + .list-item { border-block-start: 1px solid var(--line); }
.list.card .list-item:is(:hover, :focus-visible) { background: #f5f6ff; outline-offset: -2px; }
.list-item > svg:last-child { color: var(--muted); }
[dir="rtl"] .list-item > svg:last-child, [dir="rtl"] .calendar-controls .icon-button svg { transform: scaleX(-1); }
.list-label, .list-value { display: grid; gap: 2px; min-width: 0; text-align: start; }
.list-label { flex: 1 1 85px; }
.list-value { text-align: end; }
.list-label small, .list-value small { color: var(--muted); overflow-wrap: anywhere; }
.client-mark { display: inline-grid; width: 36px; height: 36px; flex-shrink: 0; place-items: center; border: 1px solid var(--accent, #b9c4ff); border-radius: 10px; background: color-mix(in srgb, var(--accent, var(--brand)) 14%, white); color: var(--ink); font-size: .82rem; font-weight: 750; }
.client-mark:empty { width: 12px; height: 12px; border-radius: 50%; background: var(--accent, var(--brand)); }

.status, .badge, .pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 100px;
  background: var(--brand-soft);
  color: #263aa5;
  font-size: .72rem;
  font-weight: 670;
  line-height: 1.35;
}

.status:is(.done, .paid, .success), .badge.success { background: var(--success-soft); color: var(--success); }
.status:is(.pending, .warning, .due), .badge.warning { background: var(--warning-soft); color: var(--warning); }
.status:is(.cancelled, .danger), .badge.danger { background: var(--danger-soft); color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.button, .icon-button {
  display: inline-flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  font-size: .87rem;
  font-weight: 670;
  line-height: 1.2;
  transition: background var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}

.button:active:not(:disabled), .icon-button:active:not(:disabled) { transform: translateY(1px); }
.button svg, .icon-button svg { width: 18px; height: 18px; }
.button:hover, .icon-button:hover { border-color: #b7c1f6; background: #f2f4ff; }
.button.primary { border-color: var(--brand); background: var(--brand); color: white; }
.button.primary:hover { border-color: var(--brand-hover); background: var(--brand-hover); }
.button.secondary { border-color: #d5ddff; background: var(--brand-soft); color: #283caa; }
.button.secondary:hover { border-color: #aab8ff; background: #e3eaff; }
.button.quiet { border-color: transparent; background: transparent; color: var(--brand); }
.button.quiet:hover { background: var(--brand-soft); }
.button.danger { border-color: #f0d1d3; background: var(--danger-soft); color: var(--danger); }
.button.danger:hover { border-color: #e6b6bc; background: #fbe4e5; }
.button.compact { min-height: 38px; padding: 6px 10px; }
.button.full { width: 100%; }
.icon-button { flex-shrink: 0; width: 44px; padding: 0; }

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: clamp(20px, 4vw, 36px) 18px;
  text-align: center;
}

.empty p { max-width: 40ch; color: var(--muted); }
.empty > svg, .empty-icon { box-sizing: content-box; width: 24px; height: 24px; padding: 9px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); }

form { min-width: 0; }
.fields, .sheet-body { display: grid; gap: 14px; }
.field { display: grid; min-width: 0; gap: 5px; }
.field > :is(label, span:first-child), legend { color: var(--ink); font-size: .86rem; font-weight: 670; }
.field small, .field-hint { color: var(--muted); }
.search-field { position: relative; max-width: 380px; }
.search-field > svg { position: absolute; z-index: 1; inset-inline-start: 12px; inset-block-start: 12px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.search-field > input[type="search"] { padding-inline-start: 40px; }
.language-control { display: block; max-width: 220px; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.day-fields { display: grid; gap: 8px; }
.day-fields legend, .color-palette legend { margin-block-end: 6px; }
.day-fields > .button { justify-self: start; }
.date-rows { display: grid; gap: 7px; }
.date-rows:empty, .form-feedback:has(> [hidden]:only-child) { display: none; }
.date-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.color-palette > div { display: grid; width: min(100%, 352px); grid-template-columns: repeat(8, minmax(0, 1fr)); }
.color-palette label { position: relative; display: grid; min-height: 44px; place-items: center; }
.color-palette input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.color-palette label > span { display: block; width: 25px; height: 25px; border-radius: 50%; background: var(--accent); pointer-events: none; }
.color-palette input:checked + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.color-palette input:focus-visible + span { box-shadow: 0 0 0 7px #4d65df35; }

input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--ease), box-shadow var(--ease);
}

textarea { min-height: 85px; resize: vertical; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--brand); }
input[type="color"] { width: 48px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
:is(input, select, textarea):focus-visible { border-color: #889af2; outline: 0; box-shadow: 0 0 0 3px #4d65df24; }
.check-row { display: flex; min-height: 42px; align-items: center; gap: 9px; }
.check-row input { width: 18px; height: 18px; margin: 0; }
.form-error, .error { color: var(--danger); }
.alert { padding: 9px 12px; border: 1px solid #f4dbb1; border-radius: 10px; background: var(--warning-soft); color: var(--warning); }
.alert.error { border-color: #f0d1d3; background: var(--danger-soft); color: var(--danger); }

.sheet {
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  max-width: none;
  max-height: min(89vh, 89dvh);
  margin: 0;
  padding: 17px 16px calc(17px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 14px 42px #141b3950;
}

.sheet[open] { animation: sheet-in 180ms ease-out both; }
.sheet::backdrop { background: #1e253c68; }
.sheet > form { display: grid; gap: 16px; }
.sheet-header > :is(h2, div):first-child { flex: 1 1 190px; overflow-wrap: anywhere; }
.sheet-header p { margin-block-start: 5px; color: var(--muted); }
.sheet-footer { justify-content: flex-end; padding-block-start: 10px; border-block-start: 1px solid var(--line); }
.sheet-footer .button.primary { min-width: 104px; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.detail-stack { display: grid; gap: 16px; min-width: 0; }
.detail-stack > .section-heading { justify-content: flex-start; margin: 0; }
.detail-stack > .section-heading .status { margin-inline-start: auto; }
.detail-stack > section > :is(h3, .muted) { margin-block-end: 8px; }
.summary-card > div { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 5px 12px; }
.summary-card > div + div { padding-block-start: 7px; border-block-start: 1px solid var(--line); }
.summary-card > div > span { color: var(--muted); }
.summary-card > div > strong { color: var(--ink); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; padding: 0; list-style: none; }
.chips > li { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 8px; background: var(--brand-soft); color: #263aa5; font-size: .79rem; }
.chips > li:has(button) { padding-block: 0; padding-inline-end: 0; }
.chips .icon-button { width: 40px; min-height: 40px; border-color: transparent; background: transparent; color: inherit; }
.chips .icon-button:hover { background: #dce4ff; }
.note-copy { overflow-wrap: anywhere; white-space: pre-wrap; }
.memo-card { margin-block-start: 8px; }
.recording-card { background: #f7f8ff; }
.recording-card .section-heading, .memo-card .section-heading { margin-block-end: 0; }

.login {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px));
  background: radial-gradient(ellipse at 80% 0%, #e7ebff, transparent 55%), var(--background);
}

.login-card {
  display: grid;
  width: min(100%, 420px);
  gap: 17px;
  padding: clamp(22px, 5vw, 35px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 16px 38px #252f6520;
}

.login-card form { display: grid; gap: 13px; }
.login-card h1 { font-size: clamp(1.75rem, 5vw, 2.25rem); }
.login-card p { color: var(--muted); }
.login-card .form-error { color: var(--danger); }
.login-card .language-control { margin-block-start: 2px; }

.toast {
  position: fixed;
  z-index: 30;
  inset-inline: 12px;
  inset-block-end: calc(70px + env(safe-area-inset-bottom, 0px));
  width: fit-content;
  max-width: min(calc(100% - 24px), 460px);
  margin-inline: auto;
  padding: 11px 15px;
  border-radius: 12px;
  background: #202840;
  color: #fff;
  box-shadow: 0 7px 20px #21273c40;
  font-size: .88rem;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.toast:empty { display: none; }
audio, .recording-player { width: 100%; }
hr, .divider { margin-block: 12px; border: 0; border-block-start: 1px solid var(--line); }

@media (min-width: 600px) {
  .topbar-date { display: inline; }
  .content { padding-inline: 24px; }
  .card, .calendar, .summary-card { padding: 20px; }
  .job-card { padding: 17px 18px; padding-inline-start: 22px; }
  .day { min-height: 72px; }
  .hero-art { inset-inline-end: 0; opacity: .85; }
  .fields.two-columns, .fields.columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields > .full { grid-column: 1 / -1; }
  .sheet {
    inset: 0;
    width: min(calc(100% - 34px), 540px);
    max-height: min(calc(100vh - 34px), calc(100dvh - 34px));
    margin: auto;
    padding: 23px;
    border-radius: 20px;
  }
}

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .sidebar {
    position: sticky;
    inset-block-start: 0;
    display: flex;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    gap: 25px;
    padding: 23px 17px;
    overflow-y: auto;
    border-inline-end: 1px solid var(--line);
    background: var(--surface);
  }
  .sidebar .brand { margin-inline: 9px; min-height: 42px; }
  .sidebar-nav { display: grid; gap: 5px; }
  .sidebar .nav-item { min-height: 46px; padding: 9px 12px; }
  .sidebar-footer { display: grid; gap: 7px; margin-block-start: auto; padding-block-start: 14px; border-block-start: 1px solid var(--line); }
  .bottom-nav { display: none; }
  .topbar { min-height: 68px; padding-inline: clamp(24px, 4vw, 48px); }
  .topbar-brand { display: none; }
  .topbar-context { display: block; color: var(--muted); font-weight: 630; }
  .topbar-actions { margin-inline-start: auto; }
  .content { padding: 33px clamp(24px, 4vw, 48px) 56px; }
  .content > section + section { margin-block-start: 30px; }
  .hero { min-height: 203px; border-radius: 22px; }
  .hero-art { inset-inline-end: 20px; }
  .toast { inset-inline: auto 22px; inset-block-end: 22px; }
}

@media (max-width: 490px) {
  .stats-grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .stats-grid:has(> :nth-child(3)) .stat { display: grid; gap: 7px; padding: 9px; }
  .stats-grid:has(> :nth-child(3)) .stat :is(span, p, small, .stat-label) { font-size: .74rem; }
  .stats-grid:has(> :nth-child(3)) .stat strong { font-size: clamp(1rem, 5vw, 1.4rem); }
  .calendar-card { padding: 12px; }
  .calendar-controls .icon-button { width: 40px; }
  .calendar-controls .button { padding-inline: 7px; }
  .hero-art { opacity: .44; }
}

@media (max-width: 380px) {
  .color-palette > div { width: min(100%, 210px); grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
