:root {
  color-scheme: light;
  --ink: #172742;
  --muted: #56657b;
  --border: #e0e6ee;
  --surface: #fff;
  --background: #f5f7fb;
  --sidebar: #102241;
  --sidebar-ink: #bac7dc;
  --selection: #243b5b;
  --teal: #006658;
  --primary: #102b4e;
  --radius: 12px;
  font: 15px/1.48 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #168482; outline-offset: 3px; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
.primary, .secondary, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border: 1px solid transparent; border-radius: 9px; padding: 0 14px;
  font-size: .9rem; font-weight: 650; white-space: nowrap;
}
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: #234469; }
.secondary, .icon-button { background: var(--surface); border-color: var(--border); color: var(--ink); }
.secondary:hover, .icon-button:hover { background: #edf3f9; border-color: #c8d6e4; }
.icon-button { width: 42px; padding: 0; }
.gate { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 25% 15%, #e0f3ee, transparent 55%), var(--background); }
.gate-card { width: min(100%, 430px); background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 36px; box-shadow: 0 20px 55px #17274212; }
.auth-brand { display: block; width: 185px; max-width: 100%; height: auto; margin-bottom: 24px; }
.gate-card h1 { font-size: 1.68rem; letter-spacing: -.045em; margin: 0 0 24px; }
.gate-card label { display: block; font-size: .87rem; font-weight: 650; margin-bottom: 6px; }
.gate-card input { width: 100%; }
.gate-card p { color: var(--muted); }
.auth-submit { width: 100%; justify-content: space-between; margin-top: 8px; }
.workspace {
  --sidebar-default-width: 242px;
  display: grid; grid-template-columns: clamp(190px, var(--sidebar-preferred-width, var(--sidebar-default-width)), calc(100% / 3)) minmax(0,1fr);
  min-height: 100svh;
}
.sidebar {
  --project-grip-width: 26px;
  grid-area: 1 / 1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100svh;
  padding: 28px 15px 15px; background: var(--sidebar); color: var(--sidebar-ink); overflow: auto;
}
.sidebar-resizer {
  grid-area: 1 / 1; justify-self: end; position: sticky; top: 0; z-index: 3;
  width: 12px; height: 100svh; margin-inline-end: -6px; cursor: col-resize; touch-action: none;
}
.sidebar-resizer::after {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 5px; width: 2px; pointer-events: none;
  background: var(--border);
}
.sidebar-resizer:hover::after, .sidebar-resizer:focus-visible::after, .sidebar-resizing .sidebar-resizer::after { background: #168482; }
.sidebar-resizing { cursor: col-resize; user-select: none; }
.brand { color: #fff; display: flex; align-items: center; gap: 10px; padding: 0 9px; margin-bottom: 35px; width: fit-content; font-size: 1.38rem; font-weight: 760; letter-spacing: -.045em; }
.brand img, .mobile-brand img { width: 35px; height: 35px; border-radius: 9px; box-shadow: 0 0 0 1px #ffffff17; }
.nav-group { display: grid; gap: 4px; }
.nav-link { display: flex; width: 100%; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; color: inherit; min-height: 42px; border-radius: 8px; border: 0; background: transparent; text-align: left; font-size: .91rem; font-weight: 570; }
#navigation .nav-link { padding-inline-end: calc(12px + var(--project-grip-width)); }
.nav-link span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover { background: #1b3151; color: #fff; }
.nav-link.selected { color: #fff; background: var(--selection); box-shadow: inset 3px 0 #2bd1ad; }
.nav-link.selected .icon { color: #83eddb; }
.nav-link small { font-size: .72rem; font-weight: 650; color: #d4e1f1; background: #ffffff15; margin-left: auto; border-radius: 5px; padding: 0 5px; }
.nav-projects { margin-top: 25px; }
.nav-label { text-transform: uppercase; letter-spacing: .12em; font-size: .69rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; padding-left: 12px; margin-bottom: 4px; }
.nav-add { border: none; color: #c8d5e8; background: transparent; width: 32px; min-height: 34px; }
.nav-add:hover { background: #263f60; color: white; }
.project-dot { display: inline-flex; border: 2px solid #78cdbd; border-radius: 4px; width: 11px; height: 11px; flex: 0 0 11px; margin: 0 4px; }
.project-nav { padding-top: 7px; padding-bottom: 7px; min-height: 38px; }
.project-menu-row { position: relative; }
.project-grip {
  position: absolute; inset-block: 0; inset-inline-end: 0; width: var(--project-grip-width);
  display: grid; place-items: center; padding: 0; border: 0;
  border-radius: 6px; color: #b5c7dd; background: transparent; cursor: grab; touch-action: none;
}
.project-grip:hover, .project-grip:focus-visible { color: #fff; background: #263f60; }
.project-grip .icon { width: 16px; height: 16px; }
.project-dragging { opacity: .55; }
.project-dragging .project-grip { cursor: grabbing; }
.project-menu-row.drop-before::after, .project-menu-row.drop-after::after {
  content: ''; position: absolute; inset-inline: 0; height: 2px; background: #2bd1ad; pointer-events: none;
}
.project-menu-row.drop-before::after { top: 0; }
.project-menu-row.drop-after::after { bottom: 0; }
.task-drop-active [data-task-destination]:not(.task-drop-available) { opacity: .45; }
.task-drop-active .task-drop-available { box-shadow: inset 0 0 0 1px #78cdbd75; }
.task-drop-active .task-drop-target {
  color: #fff; background: #185a55; box-shadow: inset 0 0 0 2px #70e1c6;
}
@media (pointer: coarse) {
  .sidebar { --project-grip-width: 40px; }
  .project-menu-row .project-nav { min-height: 44px; }
}
.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.signout { border-top: 1px solid #ffffff17; border-radius: 0; padding-top: 15px; }
.mobile-header, .nav-cover { display: none; }
.main-content { grid-area: 1 / 2; width: min(100%, 1420px); padding: 38px clamp(22px,4.2vw,68px) 64px; margin: 0 auto; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 23px; }
.page-date { margin: 0 0 3px; color: var(--muted); font-weight: 590; font-size: .88rem; }
.page-header h1 { margin: 0; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.12; letter-spacing: -.066em; font-weight: 760; overflow-wrap: anywhere; }
.project-description { color: var(--muted); margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.page-actions { display: flex; align-items: center; gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; margin-bottom: 24px; }
.stat { text-align: left; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--ink); display: grid; grid-template-columns: 42px 1fr; column-gap: 12px; padding: 13px 15px; align-items: center; }
.stat:hover { border-color: #a7bfcd; }
.stat-icon, .section-icon { color: #25546c; background: #eaf1fa; display: grid; place-items: center; border-radius: 9px; }
.stat-icon { width: 40px; height: 40px; grid-row: span 2; }
.stat-icon.check, .section-icon.check { background: #e6f5ef; color: #086757; }
.stat-icon.followup { background: #fff2e2; color: #894b11; }
.stat-value { font-size: 1.48rem; font-weight: 750; line-height: 1.12; letter-spacing: -.045em; }
.stat-label { color: var(--muted); font-size: .76rem; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.search { display: flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--border); padding: 0 11px; border-radius: 9px; min-height: 42px; min-width: 160px; max-width: 430px; color: var(--muted); flex: 1 1 180px; }
.search:focus-within { border-color: #178d83; box-shadow: 0 0 0 2px #178d8326; }
.search input { width: 100%; min-width: 0; border: 0; padding: 6px 0; color: var(--ink); background: transparent; }
.search input:focus { outline: none; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-group { display: flex; border-radius: 8px; background: #e8edf5; padding: 3px; gap: 2px; }
.filter-group button { background: transparent; border: none; border-radius: 6px; min-height: 34px; padding: 0 9px; font-size: .8rem; font-weight: 620; color: var(--muted); white-space: nowrap; }
.filter-group button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #17274217; }
.done-filter { min-height: 36px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .79rem; white-space: nowrap; }
input[type=checkbox] { accent-color: var(--teal); height: 16px; width: 16px; margin: 0; flex: 0 0 auto; }
.filters select { min-height: 40px; max-width: 165px; font-size: .8rem; }
.delegation-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: -8px 0 16px; }
.delegation-filters .field { flex: 1 1 160px; max-width: 240px; }
.delegation-stats { width: 100%; border-collapse: collapse; font-size: .85rem; }
.delegation-stats th, .delegation-stats td { border-top: 1px solid var(--border); padding: 8px; text-align: right; }
.delegation-stats th:first-child { padding-left: 14px; text-align: left; overflow-wrap: anywhere; }
.delegation-stats tbody th { font-weight: 500; }
.delegation-stats tfoot { background: #f4f7fa; font-weight: 700; }
.task-section { margin-bottom: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; }
.section-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.section-head h2 { font-size: 1rem; font-weight: 750; margin: 0; letter-spacing: -.022em; }
.section-icon { width: 29px; height: 29px; border-radius: 7px; }
.section-icon .icon { width: 15px; height: 15px; }
.section-icon.flag { background: #fff0e8; color: #a63b24; }
.section-icon.pinned { background: #fff0b3; color: #8a5b00; }
.section-icon.pinned .icon { fill: #f2bd26; }
.count { color: #51627a; background: #ecf0f6; font-size: .72rem; padding: 2px 6px; border-radius: 6px; font-weight: 650; }
.task-list { list-style: none; margin: 0; padding: 0; }
.task-row { border-top: 1px solid #e9edf2; display: flex; align-items: flex-start; gap: 10px; padding: 12px 13px 12px 14px; }
.task-row:hover { background: #fafcff; }
.task-row.task-dragging { opacity: .55; }
.task-move.icon-button { min-height: 32px; width: 32px; flex: 0 0 32px; padding: 0; cursor: grab; touch-action: none; }
.task-dragging .task-move { cursor: grabbing; }
@media (pointer: coarse) {
  .task-move.icon-button { min-height: 44px; }
}
.task-row-controls { display: grid; justify-items: center; gap: 4px; flex: none; }
.pin-button {
  display: grid; width: 20px; height: 20px; margin: 2px 2px 0 0; padding: 0; place-items: center;
  border: 1px solid #9babc0; border-radius: 6px; background: #fff; color: #657790;
}
.pin-button .icon { width: 14px; height: 14px; }
.pin-button:hover, .pin-button[aria-pressed=true] { color: #855900; border-color: #b3871d; background: #fff1bc; }
.complete-button { display: grid; width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 2px 0 0; border: 1px solid #9babc0; border-radius: 6px; background: #fff; place-items: center; color: white; padding: 0; }
.complete-button .icon { width: 14px; height: 14px; opacity: 0; }
.complete-button:hover { color: var(--teal); border-color: var(--teal); }
.complete-button:hover .icon, .complete-button[aria-pressed=true] .icon { opacity: 1; }
.complete-button[aria-pressed=true] { color: white; background: var(--teal); border-color: var(--teal); }
.task-body { min-width: 0; flex: 1; }
.task-title { text-align: left; padding: 0; border: 0; background: transparent; font-weight: 720; letter-spacing: -.012em; color: var(--ink); max-width: 100%; overflow-wrap: anywhere; }
.task-title:hover { color: #065e53; text-decoration: underline; }
.completed .task-title { text-decoration: line-through; color: var(--muted); }
.task-preview { color: var(--muted); font-size: .83rem; margin-top: 1px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-meta { color: var(--muted); display: flex; gap: 7px 10px; flex-wrap: wrap; align-items: center; font-size: .73rem; margin-top: 6px; }
.assignment-indicators { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: .73rem; }
.assignment-indicators strong { font-variant-numeric: tabular-nums; }
.assignment-indicators .assignment-over-threshold { color: #ac302d; }
.reference { font-size: .71rem; font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace; }
.task-meta .icon { width: 13px; height: 13px; }
.task-meta a, .meta-link, .modal-link { color: #1e6586; }
.task-meta a:hover, .meta-link:hover, .modal-link:hover { text-decoration: underline; }
.badge { border-radius: 5px; padding: 1px 6px; font-weight: 700; }
.badge.urgent { color: #972f2f; background: #fce8e8; }
.badge.high { color: #925018; background: #fff0dd; }
.badge.waiting { color: #514480; background: #eeeafa; }
.due { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .81rem; font-weight: 630; margin-top: 3px; color: var(--muted); }
.due .icon { width: 15px; height: 15px; }
.due.overdue { color: #a53833; }
.due.today { color: var(--teal); }
.row-arrow { color: #617390; border: none; width: 28px; min-height: 27px; background: transparent; }
.row-arrow .icon { width: 16px; height: 16px; }
.empty-row { color: var(--muted); margin: 0; border-top: 1px solid #e9edf2; padding: 15px; font-size: .87rem; }
.empty { display: flex; align-items: center; gap: 15px; padding: 24px; background: #fff; border: 1px dashed #bac9da; border-radius: var(--radius); }
.empty > .icon { width: 27px; height: 27px; color: var(--teal); }
.empty p { margin: 3px 0 0; color: var(--muted); }
.project-shortcuts .section-head { padding-left: 0; }
.add-project { margin-left: auto; min-height: 34px; }
.project-cards, .contact-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,245px),1fr)); gap: 10px; }
.project-card, .contact-row { display: flex; gap: 10px; align-items: center; background: #fff; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--ink); text-align: left; min-width: 0; }
.project-card:hover, .contact-row:hover { border-color: #a7bfcd; background: #fff; }
.project-card > span:nth-child(2) { flex: 1; font-weight: 650; overflow-wrap: anywhere; }
.project-card small { display: block; color: var(--muted); font-weight: 500; }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 10px; background: #dcf4ed; color: #116458; font-weight: 750; display: grid; place-items: center; }
.contact-body { flex: 1; min-width: 0; }
.contact-body > * { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-body span, .contact-count { color: var(--muted); font-size: .74rem; }
.contact-count { white-space: nowrap; }
.contact-details dt { color: var(--muted); font-size: .82rem; }
.contact-details dd { margin: 0; overflow-wrap: anywhere; }
dialog { width: min(calc(100% - 28px), 640px); max-height: calc(100dvh - 30px); border: 1px solid var(--border); border-radius: 18px; padding: 0; color: var(--ink); box-shadow: 0 24px 84px #0b1c3b42; }
dialog::backdrop { background: #11254177; }
.modal-shell { display: flex; flex-direction: column; }
.modal-header { display: flex; position: sticky; top: 0; z-index: 2; margin: 0; padding: 13px 20px; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--border); background: #fff; }
.modal-header h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.04em; }
.modal-header .icon-button { width: 36px; min-height: 36px; }
.modal-body { padding: 18px 20px 10px; }
.modal-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 11px 20px; background: #fff; border-top: 1px solid var(--border); }
.modal-footer #delete-project { margin-right: auto; }
.modal-footer .delete-project { background: #af2936; border-color: #af2936; color: #fff; }
.modal-footer .delete-project:hover:enabled { background: #92202d; border-color: #92202d; }
.modal-footer .delete-project:disabled { background: #f2f3f5; border-color: var(--border); color: var(--muted); cursor: not-allowed; opacity: 1; }
#project-delete-hint:empty { display: none; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 4px; margin-bottom: 12px; }
.field > span { color: var(--ink); font-size: .82rem; font-weight: 690; }
input:not([type=checkbox],[type=search],[type=file]), select, textarea { min-height: 41px; border: 1px solid #cfd9e5; background: #fff; color: var(--ink); border-radius: 8px; padding: 7px 9px; min-width: 0; }
.filters select, .delegation-filters select, .dashboard-person select {
  appearance: none;
  cursor: pointer;
  padding-inline-end: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: right 15px center, right 10px center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.delegation-filters .field, .dashboard-person .field {
  position: relative;
}
.delegation-filters .field > span, .dashboard-person .field > span {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 11px;
  pointer-events: none;
}
.delegation-filters .field > select, .dashboard-person .field > select {
  width: 100%;
  min-height: 55px;
  padding-block-start: 22px;
}
input[type=date] { width: 100%; max-width: 100%; }
textarea { line-height: 1.45; resize: vertical; white-space: pre-wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 12px; }
.form-hint { font-size: .8rem; margin: 4px 0; }
.form-error { color: #a43232 !important; font-size: .88rem; margin: 7px 0; }
.form-error:empty { display: none; }
.record-id { color: var(--muted); font-size: .8rem; margin: 0 0 10px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--ink); }
label.check-label { padding: 3px 0; }
.related-field { border: 1px solid var(--border); border-radius: 8px; margin: 11px 0; padding: 6px 10px; }
.related-field legend { padding: 0 4px; font-size: .8rem; font-weight: 650; }
.related-list { max-height: 140px; overflow: auto; }
.project-access-list .check-label { display: flex; }
.related-person { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 2px 0; }
.meta-link { background: transparent; border: 0; padding: 0; text-align: left; font-size: inherit; overflow-wrap: anywhere; }
.modal-link { display: inline-flex; align-items: center; gap: 5px; font-size: .86rem; }
.modal-link .icon { width: 15px; height: 15px; }
.contact-tasks { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
.contact-tasks div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contact-tasks h3 { margin: 0; font-size: 1rem; }
.contact-tasks p, .contact-tasks li > span { color: var(--muted); font-size: .8rem; }
.contact-tasks ul { padding: 0; list-style: none; margin: 8px 0; }
.contact-tasks li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 5px 0; }
.contact-tasks li > span { flex-shrink: 0; }
.scan-panel { display: grid; justify-items: center; border: 1px dashed #bbccdb; border-radius: 12px; background: #f5f9fb; padding: 24px 12px; }
.scan-panel > .icon { width: 29px; height: 29px; color: #076956; }
.scan-panel p { margin: 10px 0 14px; text-align: center; color: var(--muted); }
.scan-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.file-button { position: relative; cursor: pointer; }
.file-button:focus-within { outline: 3px solid #168482; outline-offset: 3px; }
.file-button input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
#scan-status, .scan-notice { font-size: .87rem; color: var(--muted); }
.scan-notice { margin: 0 0 10px; }
.duplicate { color: #804706; background: #fff2e0; padding: 8px; margin: 0 0 10px; border-radius: 7px; font-size: .85rem; }
.recognized { color: var(--muted); font-size: .82rem; }
.recognized pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 10; bottom: 16px; right: 16px; padding: 11px 16px; max-width: calc(100% - 32px); background: #132b4b; color: white; border-radius: 9px; box-shadow: 0 6px 24px #0d1f373d; font-weight: 620; }
@media (max-width: 900px) {
  .workspace { --sidebar-default-width: 200px; }
  .main-content { padding-left: 23px; padding-right: 23px; }
}
@media (max-width: 700px) {
  .workspace { display: block; }
  .sidebar-resizer { display: none; }
  .sidebar { position: fixed; z-index: 6; inset: 0 auto 0 0; width: min(280px,83vw); height: 100dvh; transform: translateX(-100%); visibility: hidden; }
  .sidebar.open { transform: none; visibility: visible; }
  .nav-cover { display: block; position: fixed; inset: 0; z-index: 5; background: #13223d82; border: 0; }
  .mobile-header { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); min-height: 60px; padding: 0 13px; margin: 0 -13px 20px; }
  .mobile-header .icon-button { width: 37px; min-height: 37px; }
  .mobile-brand { display: flex; gap: 7px; align-items: center; font-weight: 730; }
  .mobile-brand img { width: 26px; height: 26px; border-radius: 6px; }
  .main-content { padding: 0 13px 40px; }
  .page-header { align-items: flex-start; margin-bottom: 15px; gap: 8px; flex-direction: column; }
  .page-header h1 { font-size: clamp(1.85rem,6vw,2.6rem); }
  .page-actions { margin-top: 5px; gap: 6px; }
  .page-actions .refresh { order: 3; }
  .stats { gap: 6px; margin-bottom: 16px; }
  .stat { padding: 9px 7px; grid-template-columns: 25px minmax(0,1fr); column-gap: 5px; }
  .stat-icon { width: 25px; height: 25px; grid-row: 1; border-radius: 5px; }
  .stat-icon .icon { width: 14px; height: 14px; }
  .stat-value { font-size: 1.03rem; }
  .stat-label { grid-column: span 2; padding-top: 3px; font-size: .7rem; line-height: 1.18; }
  .toolbar { margin-bottom: 16px; gap: 6px; }
  .search { max-width: none; flex-basis: 100%; }
  .filters { gap: 6px; }
  .task-row { padding: 10px 8px; gap: 7px; }
  .complete-button, .pin-button { width: 23px; height: 23px; flex-basis: 23px; }
  .task-title { font-size: .91rem; }
  .task-preview { font-size: .77rem; }
  .task-meta { gap: 4px 7px; }
  .row-arrow { display: none; }
  .due { font-size: .71rem; gap: 2px; }
  .due .icon { width: 12px; height: 12px; }
  .task-section { margin-bottom: 16px; }
  .section-head { padding: 9px 8px; }
  .gate-card { padding: 25px; }
  .modal-header, .modal-footer { padding-left: 13px; padding-right: 13px; }
  .modal-body { padding-left: 13px; padding-right: 13px; }
  .form-grid { gap: 0 7px; }
  .form-grid input, .form-grid select, .field textarea, .field input, .search input { font-size: 16px; }
}
@media (max-width: 335px) {
  .form-grid { grid-template-columns: 1fr; }
  .stat { padding-left: 4px; padding-right: 4px; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.nav-link { gap: 8px; }
.nav-link .nav-name { flex: 1; }
.task-counts { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex: 0 0 auto; }
.nav-count { min-width: 21px; padding: 1px 4px; text-align: center; font-size: .71rem; font-weight: 750; border-radius: 5px; font-variant-numeric: tabular-nums; }
.nav-count.urgent-count { color: #a3333d; background: #fee8ea; }
.nav-count.active-count { color: #344a65; background: #e8eef7; }
.sidebar .task-counts { display: inline-grid; grid-template-columns: repeat(2,max-content); }
.sidebar .nav-count { grid-row: 1; width: calc(4ch + 4px); padding-inline: 2px; }
.sidebar .urgent-count { grid-column: 1; color: #ffc8d6; background: #f982a82e; }
.sidebar .active-count { grid-column: 2; color: #e2ebf8; background: #ffffff21; }
.project-card .task-counts { flex: 0 0 auto; }
.stat-icon.delegated { background: #fff2e2; color: #894b11; }
.task-context { margin: 14px 0 17px; padding: 13px 14px; background: #f7f9fc; border: 1px solid var(--border); border-radius: 10px; }
.task-assignment { margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #f7f9fc; }
.task-assignment .field { margin-bottom: 5px; }
.task-assignment p.field { margin-top: 0; }
.transfer-controls { min-width: 0; }
.transfer-controls .transfer-button { width: 100%; min-height: 40px; }
.transfer-controls .form-hint { color: var(--muted); }
.task-confidential { margin-top: 4px; }
.task-confidential .check-label { color: #ac302d; font-weight: 650; }
.task-confidential input { accent-color: #ac302d; }
.task-context h3 { margin: 0 0 8px; font-size: .98rem; letter-spacing: -.017em; }
.context-timeline { margin: 0; padding: 0; list-style: none; }
.context-timeline li { padding: 8px 0 9px; }
.context-timeline li + li { border-top: 1px solid var(--border); }
.context-timeline time, .context-date { color: var(--teal); font-size: .79rem; font-weight: 720; }
.context-timeline p { white-space: pre-line; overflow-wrap: anywhere; font-size: .95rem; line-height: 1.58; margin: 4px 0 0; }
.context-edit { margin: 4px 0 0; }
.context-edit summary { font-size: .81rem; color: #1e6586; cursor: pointer; }
.context-edit[open] summary { margin-bottom: 8px; }
.context-edit textarea { min-height: 9rem; }
.task-context .field:last-child { margin-bottom: 0; }
.source-email { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; min-width: 0; }
.source-email a { color: #1e6586; font-weight: 650; }
.source-email a:hover { text-decoration: underline; }
.source-email .icon { width: 14px; height: 14px; }
.source-mailbox { color: var(--muted); overflow-wrap: anywhere; }
.task-source .source-email, .source-date { font-size: .84rem; }
.source-date { color: var(--muted); margin: 2px 0; }
.restore-task { min-height: 32px; padding: 0 8px; font-size: .79rem; }

.project-children { margin-left: 18px; padding-left: 7px; border-left: 1px solid #ffffff24; }
.child-nav .project-dot { width: 8px; height: 8px; flex-basis: 8px; border-radius: 50%; }
.project-parent:hover { text-decoration: underline; }
.subproject-shortcuts { margin-bottom: 19px; }
.stat-icon.flag { background: #fff0e8; color: #a63b24; }
.task-subprojects .check-label { margin-right: 16px; }

.filter-group { flex-wrap: wrap; }

.record-id { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; }
.reference-pill { padding: 2px 6px; border-radius: 5px; color: #24415e; background: #e8eef7; font-family: ui-monospace, monospace; }

.mobile-tabs { display: none; }
@media (max-width: 700px) {
  .main-content { padding-left: max(13px, env(safe-area-inset-left)); padding-right: max(13px, env(safe-area-inset-right)); padding-bottom: calc(85px + env(safe-area-inset-bottom)); }
  .mobile-header { padding-top: env(safe-area-inset-top); margin-left: 0; margin-right: 0; padding-left: 0; }
  .sidebar { padding-top: max(28px, env(safe-area-inset-top)); padding-bottom: max(15px, env(safe-area-inset-bottom)); }
  .mobile-header .icon-button, .page-actions .primary, .page-actions .secondary, .page-actions .refresh { min-height: 44px; }
  .mobile-header .icon-button { width: 44px; }
  .mobile-tabs {
    display: grid; position: fixed; inset: auto 0 0; z-index: 4;
    grid-template-columns: repeat(5,minmax(0,1fr));
    padding: 3px max(3px,env(safe-area-inset-right)) calc(3px + env(safe-area-inset-bottom)) max(3px,env(safe-area-inset-left));
    background: #fff; border-top: 1px solid var(--border); box-shadow: 0 -4px 20px #182b420c;
  }
  .mobile-tabs a {
    min-height: 55px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 4px 1px; color: var(--muted); font-size: clamp(.61rem,2.7vw,.75rem); font-weight: 650; border-radius: 8px;
  }
  .mobile-tabs a[aria-current=page] { background: #e4f4ed; color: #075e50; }
  .mobile-tabs .icon { width: 22px; height: 22px; }
  .task-row { align-items: flex-start; }
  .complete-button { width: 44px; height: 44px; flex-basis: 44px; margin: -4px -5px 0 -6px; border-color: transparent; background: transparent; position: relative; }
  .complete-button::before { content: ''; position: absolute; width: 22px; height: 22px; border: 1px solid #9babc0; border-radius: 6px; background: #fff; }
  .complete-button[aria-pressed=true] { background: transparent; border-color: transparent; }
  .complete-button[aria-pressed=true]::before { background: var(--teal); border-color: var(--teal); }
  .complete-button .icon { position: relative; }
  .task-row-controls { gap: 0; }
  .pin-button { width: 44px; height: 40px; margin: -4px -5px 0 -6px; border-color: transparent; background: transparent; position: relative; }
  .pin-button::before { content: ''; position: absolute; width: 22px; height: 22px; border: 1px solid #9babc0; border-radius: 6px; background: #fff; }
  .pin-button:hover, .pin-button[aria-pressed=true] { border-color: transparent; background: transparent; }
  .pin-button:hover::before, .pin-button[aria-pressed=true]::before { border-color: #b3871d; background: #fff1bc; }
  .pin-button .icon { position: relative; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .modal-body .form-grid { grid-template-columns: 1fr; }
}

.sidebar-account { display: block; padding: 0 10px 8px; color: #c1ccdd; overflow-wrap: anywhere; font-size: .75rem; }
.team-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.team-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 15px; background: #fff; border: 1px solid var(--border); border-radius: 9px; }
.team-list li > span:nth-child(2) { color: var(--muted); overflow-wrap: anywhere; flex: 1; }
.team-assignee { background: #e4f4ed; color: #075e50; }
.task-assignment-badges { display: inline-flex; align-items: center; gap: 5px; }
.badge.private-task { color: #a3333d; background: #fee8ea; }
.handoff-link { display: inline-flex; align-items: center; gap: 4px; }
.assigned-notes { white-space: pre-line; overflow-wrap: anywhere; }
#auth-form input[type=email] { margin-bottom: 13px; }

.recovery-link { margin-top: 14px; font-size: .87rem; }
#forgot-password { display: inline-block; }
#recovery-status:empty { display: none; }
.password-link { margin-bottom: 4px; }

.account-link { gap: 9px; }
.account-link small { display: block; font-size: .72rem; color: #c1ccdd; }
.profile-avatar { border-radius: 50%; overflow: hidden; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-link .profile-avatar, .mobile-profile .profile-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: .82rem; }
.mobile-profile { margin-left: auto; }
.team-list .team-email { flex: 1; color: var(--muted); overflow-wrap: anywhere; }
.profile-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 14px; margin-bottom: 12px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.profile-card h2 { font-size: 1rem; margin: 0; }
.profile-card p { color: var(--muted); margin: 3px 0 0; }
.profile-card .secondary { margin-left: auto; }
.modal-body > .profile-avatar { margin-bottom: 12px; }

.auth-brand { width: auto; display: flex; align-items: center; gap: 10px; font-size: 2rem; font-weight: 790; letter-spacing: -.045em; color: #102241; }
.auth-brand img { width: 48px; height: 48px; border-radius: 11px; }
.dashboard-period { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.dashboard-person { width: min(100%, 230px); }
.dashboard-person .field { margin: 0; }
.dashboard-period > span { color: var(--muted); font-size: .84rem; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.chart-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; min-width: 0; padding: 12px 10px; }
.chart-card h2 { font-size: 1rem; margin: 0 4px 4px; }
.project-chart { position: relative; }
.project-chart-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); text-decoration: none; }
.project-chart-link .icon { width: 16px; height: 16px; color: var(--teal); }
.project-chart-link::after { content: ''; position: absolute; inset: 0; border-radius: 12px; }
.project-chart:hover, .project-chart:focus-within { border-color: var(--teal); }
.project-chart-link:focus-visible { outline: none; }
.project-chart-link:focus-visible::after { outline: 3px solid var(--teal); outline-offset: 2px; }
.project-chart:hover .project-chart-link, .project-chart-link:focus-visible { text-decoration: underline; }
.bar-chart { display: flex; justify-content: center; align-items: flex-end; gap: 4px; }
.chart-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; flex: 1; color: #4179bb; font-size: .74rem; }
.chart-bar.pink { color: #bc557f; }
.chart-bar.green { color: #237a5b; }
.chart-bar.violet { color: #755aa2; }
.chart-bar svg { width: 100%; max-width: 78px; height: 130px; overflow: visible; }
.chart-bar rect { fill: currentColor; }
.chart-bar line { stroke: #e5ebf2; }
.chart-bar text { fill: #172742; font-size: 15px; font-weight: 720; }
.chart-bar > span { color: var(--muted); text-align: center; align-content: start; min-height: 2.65em; overflow-wrap: anywhere; }
.dashboard-projects { margin-top: 24px; }
.dashboard-projects .dashboard-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,430px),1fr)); }
.project-chart .bar-chart { gap: 2px; }
.project-chart .chart-bar > span { overflow-wrap: normal; }
.dashboard-projects > h2 { margin: 0 0 9px; font-size: 1.2rem; }
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 500px) {
  .chart-bar svg { height: 96px; }
  .chart-bar { font-size: .66rem; }
}
