 :root {
     --bg: #f6f0e7;
     --bg-soft: #fffaf3;
     --surface: rgba(255, 252, 247, .82);
     --surface-strong: rgba(255, 252, 247, .95);
     --text: #202321;
     --muted: #6c716c;
     --line: rgba(32, 35, 33, .10);
     --line-strong: rgba(32, 35, 33, .17);
     --accent: #2f7c73;
     --accent-strong: #25665e;
     --accent-soft: rgba(47, 124, 115, .10);
     --danger: #b42318;
     --ok: #12724f;
     --blue: #6f8fa6;
     --sand: #eadfcd;
     --radius-xl: 28px;
     --radius-lg: 22px;
     --radius-md: 14px;
     --radius-sm: 10px;
     --radius-pill: 999px;
     --shadow-sm: 0 14px 34px rgba(46, 79, 73, .07);
     --shadow-md: 0 24px 80px rgba(46, 79, 73, .12);
 }
 html {
     scrollbar-gutter: stable;
 }
 * { box-sizing: border-box; margin: 0; padding: 0; }
 body {
     min-height: 100vh;
     font-family: "Space Grotesk", "Avenir Next", "Helvetica Neue", "PingFang SC", "Noto Sans SC", sans-serif;
     color: var(--text);
     background:
         radial-gradient(circle at 12% -8%, rgba(47, 124, 115, .14), transparent 30rem),
         radial-gradient(circle at 88% 2%, rgba(111, 143, 166, .09), transparent 28rem),
         linear-gradient(145deg, #fffaf3 0%, var(--bg) 60%, #efe5d8 100%);
 }
 body::before {
     content: "";
     position: fixed;
     inset: 0;
     pointer-events: none;
     opacity: .50;
     background-image:
         linear-gradient(rgba(47, 124, 115, .045) 1px, transparent 1px),
         linear-gradient(90deg, rgba(47, 124, 115, .035) 1px, transparent 1px);
     background-size: 44px 44px;
     mask-image: linear-gradient(to bottom, #000, transparent 80%);
 }
 .shell { position: relative; max-width: 1120px; margin: 0 auto; padding: 28px 24px 36px; }
 h1 {
     font-size: 30px;
     line-height: 1;
     letter-spacing: -.035em;
     font-weight: 560;
 }
 h2 { font-size: 21px; margin-bottom: 8px; letter-spacing: .01em; }
 h3 { font-size: 15px; margin-bottom: 8px; letter-spacing: .01em; }
 p { color: var(--muted); line-height: 1.5; }
 a { color: inherit; }
 .btn {
     display: inline-flex;
     align-items: center;
     justify-content: center;
     flex: 0 0 auto;
     min-height: 38px;
     min-width: 0;
     max-width: 100%;
     padding: 8px 14px;
     border: 1px solid var(--line);
     border-radius: var(--radius-pill);
     background: rgba(255, 252, 247, .76);
     color: var(--text);
     font: inherit;
     font-size: 14px;
     font-weight: 500;
     letter-spacing: .01em;
     line-height: 1.2;
     white-space: nowrap;
     text-decoration: none;
     cursor: pointer;
     box-shadow: 0 10px 24px rgba(46, 79, 73, .075);
     backdrop-filter: blur(10px);
     transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
 }
 .btn:hover:not(:disabled) {
     border-color: var(--line-strong);
     background: rgba(255, 252, 247, .96);
     box-shadow: 0 14px 28px rgba(46, 79, 73, .10);
     transform: translateY(-1px);
 }
 .btn:active:not(:disabled) { transform: translateY(0); }
 .btn:focus-visible {
     outline: 3px solid rgba(47, 124, 115, .24);
     outline-offset: 3px;
     box-shadow: 0 14px 28px rgba(46, 79, 73, .10);
 }
 .btn.primary {
     background: var(--accent);
     border-color: var(--accent);
     color: #fff;
     box-shadow: 0 14px 34px rgba(47, 124, 115, .15);
 }
 .btn.primary:hover:not(:disabled) {
     border-color: var(--accent-strong);
     background: var(--accent-strong);
     box-shadow: 0 16px 36px rgba(47, 124, 115, .18);
 }
 .btn.primary:focus-visible {
     outline-color: rgba(47, 124, 115, .28);
     box-shadow: 0 16px 36px rgba(47, 124, 115, .18);
 }
.btn.danger {
     border-color: #fecaca;
     color: var(--danger);
     background: linear-gradient(180deg, #fff 0%, #fff6f6 100%);
     box-shadow: 0 10px 24px rgba(180, 35, 24, .06);
 }
 .btn.danger:hover:not(:disabled) {
     border-color: #fda4af;
     background: linear-gradient(180deg, #fff7f7 0%, #ffecec 100%);
     box-shadow: 0 14px 28px rgba(180, 35, 24, .10);
 }
 .btn.danger:focus-visible {
     outline-color: rgba(180, 35, 24, .22);
     box-shadow: 0 14px 28px rgba(180, 35, 24, .10);
 }
 .btn:disabled { opacity: .56; cursor: not-allowed; box-shadow: none; }
 .actions {
     display: flex;
     flex-wrap: wrap;
     align-items: center;
     gap: 9px;
     margin-top: 14px;
 }
 .actions > .btn,
 .owner-header-actions > .btn,
 .nav > .btn,
 .nav > a.btn {
     flex: 0 0 auto;
     max-width: 100%;
 }
 .actions-split {
     justify-content: space-between;
     align-items: flex-start;
     gap: 12px;
 }
 .actions-split > :first-child {
     min-width: 0;
     flex: 1 1 260px;
 }
 .actions-split > .btn,
 .actions-split > a.btn {
     flex: 0 0 auto;
 }
 .nav {
     position: sticky;
     top: 10px;
     z-index: 5;
     display: flex;
     gap: 4px;
     flex-wrap: wrap;
     margin-bottom: 16px;
     padding: 8px 10px;
     border: 1px solid var(--line);
     border-radius: var(--radius-lg);
     background: rgba(255, 252, 247, .82);
     box-shadow: var(--shadow-sm);
     backdrop-filter: blur(14px);
 }
 .nav a.btn {
     min-height: 34px;
     padding: 6px 12px;
     border: 0;
     border-radius: var(--radius-pill);
     background: transparent;
     box-shadow: none;
     color: var(--muted);
     font-size: 13px;
     font-weight: 600;
 }
 .nav a.btn:hover:not(:disabled) {
     background: rgba(255, 252, 247, .94);
     color: var(--text);
     transform: none;
     box-shadow: none;
 }
 .nav a.btn.active {
     position: relative;
     color: var(--accent-strong);
     background: rgba(47, 124, 115, .08);
 }
 .nav a.btn.active::after {
     content: "";
     position: absolute;
     left: 12px;
     right: 12px;
     bottom: 5px;
     height: 2px;
     border-radius: var(--radius-pill);
     background: var(--accent);
 }
 .nav #logoutBtn {
     margin-left: auto;
     min-height: 34px;
     padding: 6px 12px;
     border: 1px solid #f5c9c9;
     border-radius: var(--radius-pill);
     background: #fff8f8;
     box-shadow: none;
     font-size: 13px;
     font-weight: 600;
 }
 .panel {
     background:
         radial-gradient(circle at 100% 0, rgba(47, 124, 115, .055), transparent 13rem),
         linear-gradient(180deg, var(--surface-strong) 0%, var(--surface) 100%);
     border: 1px solid var(--line);
     border-radius: var(--radius-lg);
     padding: 22px;
     margin-bottom: 14px;
     box-shadow: var(--shadow-sm);
     backdrop-filter: blur(12px);
 }
.panel h2 {
    color: #365750;
    font-size: 23px;
    font-weight: 560;
    letter-spacing: -.02em;
}
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 2px;
}
.section-head-copy {
    min-width: 0;
    flex: 1 1 auto;
}
.section-head-actions {
    flex: 0 0 auto;
}
.auth-shell { max-width: 500px; margin: 24px auto 0; }
.auth-landing {
    max-width: 580px;
    margin-top: 44px;
    padding: 26px 24px 24px;
}
.auth-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-bottom: 10px;
    padding: 0 10px;
    border: 1px solid rgba(47, 124, 115, .15);
    border-radius: 999px;
    background: rgba(47, 124, 115, .08);
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.auth-copy {
    max-width: 460px;
    margin-bottom: 16px;
    color: #5f6864;
    font-size: 14px;
}
.auth-feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.auth-feature-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(47, 124, 115, .12);
    border-radius: 999px;
    background: rgba(255, 252, 247, .88);
    color: #50635d;
    font-size: 12px;
    font-weight: 600;
}
.auth-actions .btn {
    min-width: 130px;
}
 label {
     display: block;
     margin: 12px 0 6px;
     color: var(--muted);
     font-size: 12px;
     letter-spacing: .02em;
     text-transform: uppercase;
     font-weight: 700;
 }
 input:not([type="checkbox"]), textarea, select {
     width: 100%;
     border: 1px solid var(--line);
     border-radius: var(--radius-md);
     background: rgba(255, 252, 247, .92);
     color: var(--text);
     padding: 12px 13px;
     font: 14px/1.45 "Space Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
     transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
 }
 input:not([type="checkbox"])::placeholder, textarea::placeholder { color: #9a8f81; }
 input:not([type="checkbox"]):focus-visible, textarea:focus-visible, select:focus-visible {
     outline: none;
     border-color: rgba(47, 124, 115, .58);
     box-shadow: 0 0 0 3px rgba(47, 124, 115, .14);
     background: #fffdf9;
 }
textarea { min-height: 160px; resize: vertical; line-height: 1.5; }
.checkline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}
.checkline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--accent);
}
.task-create-form {
    max-width: 760px;
}
.form-actions {
    justify-content: flex-start;
}
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
 .stats {
     display: grid;
     grid-template-columns: repeat(4, minmax(0, 1fr));
     gap: 10px;
     margin-top: 14px;
 }
 .stat {
     border: 1px solid var(--line);
     border-radius: var(--radius-md);
     padding: 14px 13px;
     background: rgba(255, 252, 247, .88);
     box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
 }
 .stat b {
     display: block;
     margin-bottom: 3px;
     color: #365750;
     font-size: 24px;
     line-height: 1.02;
     letter-spacing: -.03em;
 }
 .stat span {
     color: var(--muted);
     font-size: 11px;
     letter-spacing: .03em;
     text-transform: uppercase;
     font-weight: 700;
 }
 .notice {
     display: inline-flex;
     align-items: flex-start;
     gap: 8px;
     max-width: 100%;
     margin-top: 12px;
     padding: 8px 10px;
     border-radius: var(--radius-sm);
     border: 1px solid #f4d8b3;
     border-left: 3px solid #d5883a;
     background: #fff9ef;
     color: #9a4f13;
     font: 12px/1.4 "Space Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
     white-space: pre-wrap;
     overflow-wrap: anywhere;
 }
 .overview-notice {
     display: flex;
     width: fit-content;
     max-width: 680px;
     border-color: rgba(47, 124, 115, .18);
     border-left-color: var(--accent);
     background: rgba(47, 124, 115, .07);
     color: var(--accent-strong);
 }
 .notice.error {
     border-color: #fecaca;
     border-left-color: #d92d20;
     background: #fff5f5;
     color: #9f1239;
 }
 .notice.ok {
     border-color: #bbf7d0;
     border-left-color: #16804f;
     background: #f2fcf6;
     color: #166534;
 }
 .notice.pending {
     border-color: #f4d9af;
     border-left-color: #d5883a;
     background: #fff9ef;
     color: #9a4f13;
 }
 .keybox {
     margin-top: 12px;
     border: 1px dashed rgba(179, 97, 27, .65);
     border-radius: var(--radius-md);
     background: linear-gradient(180deg, #fffcf4 0%, rgba(47, 124, 115, .07) 100%);
     padding: 12px 13px;
     font: 12px/1.45 "Space Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
     overflow-wrap: anywhere;
 }
 .overview-keybox {
     border-style: solid;
     border-color: rgba(47, 124, 115, .18);
     border-radius: 14px;
     background:
         linear-gradient(135deg, rgba(255, 252, 247, .90), rgba(47, 124, 115, .055));
     color: var(--text);
 }
 .overview-keybox.is-empty {
     color: var(--muted);
     font-family: "Space Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;
 }
 .task-layout {
     display: grid;
     grid-template-columns: 360px minmax(0, 1fr);
     gap: 14px;
     align-items: start;
 }
 .task-list { display: grid; gap: 8px; margin-top: 12px; }
 .task-item {
     width: 100%;
     text-align: left;
     border: 1px solid var(--line);
     border-radius: var(--radius-md);
     background: rgba(255, 252, 247, .88);
     padding: 13px;
     cursor: pointer;
     transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
 }
 .task-item:hover {
     border-color: var(--line-strong);
     box-shadow: 0 8px 20px rgba(23, 21, 18, .08);
     transform: translateY(-1px);
 }
 .task-item.active {
     border-color: rgba(47, 124, 115, .50);
     background: rgba(47, 124, 115, .07);
     box-shadow: 0 10px 18px rgba(47, 124, 115, .10);
 }
 .task-title {
     display: flex;
     justify-content: space-between;
     gap: 8px;
     font-weight: 700;
     color: #334a45;
 }
 .task-code-box {
     display: grid;
     grid-template-columns: minmax(0, 1fr) auto;
     gap: 10px;
     align-items: center;
     margin: 10px 0 12px;
     padding: 12px;
     border: 1px solid var(--line);
     border-radius: var(--radius-md);
     background: rgba(47, 124, 115, .06);
 }
 .task-code-box b {
     display: block;
     margin-bottom: 3px;
     color: var(--muted);
     font-size: 11px;
     font-weight: 700;
     letter-spacing: .04em;
     text-transform: uppercase;
 }
 .task-code-box code {
     display: block;
     overflow-wrap: anywhere;
     color: var(--text);
     font-size: 17px;
     font-weight: 700;
     letter-spacing: .06em;
 }
 .task-meta {
     display: grid;
     grid-template-columns: repeat(3, minmax(0, 1fr));
     gap: 6px;
     margin-top: 9px;
     color: var(--muted);
     font-size: 12px;
 }
 .badge {
     display: inline-flex;
     align-items: center;
     min-height: 22px;
     border-radius: var(--radius-pill);
     padding: 2px 9px;
     background: #f1f5f9;
     color: #334155;
     font-size: 11px;
     font-weight: 700;
     text-transform: uppercase;
     letter-spacing: .02em;
 }
 .badge.open { background: #dcfce7; color: var(--ok); }
 .badge.closed { background: #fee2e2; color: var(--danger); }
 .detail-box {
     border: 1px solid var(--line);
     border-radius: var(--radius-md);
     padding: 13px;
     background: rgba(255, 252, 247, .88);
     margin-top: 12px;
 }
.logs-filters {
    margin-top: 10px;
}
.logs-summary {
    color: #3c3428;
}
.logs-table-wrap {
    margin-top: 12px;
}
.logs-pager {
    justify-content: space-between;
}
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
 .logs-table th, .logs-table td {
     text-align: left;
     vertical-align: top;
     border-bottom: 1px solid #eee6da;
     padding: 8px 6px;
 }
 .logs-table th {
     color: #8f836f;
     text-transform: uppercase;
     letter-spacing: .03em;
     font-size: 11px;
     font-weight: 700;
 }
 .logs-table td {
     color: #3c3428;
     font-family: "Space Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
     line-height: 1.45;
     overflow-wrap: anywhere;
 }
 .logs-table tr:last-child td { border-bottom: 0; }
 .logs-empty {
     color: var(--muted);
     font-size: 13px;
     padding: 10px 2px;
 }
 #logTaskFilter {
     max-width: 420px;
 }
 .mono {
     font-family: "Space Mono", "JetBrains Mono", "SFMono-Regular", Menlo, monospace;
     font-size: 12px;
     overflow-wrap: anywhere;
 }
.muted { color: var(--muted); }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.app-only, .auth-only { display: none; }
 body.booting .app-only,
 body.booting .auth-only { display: none !important; }
 body.authed .app-only { display: block; }
 body.authed .auth-only { display: none; }
 body.guest .auth-only { display: block; }
 body.guest .app-only { display: none; }
 @media (max-width: 1024px) {
     .shell { padding: 18px 14px 24px; }
     .task-layout { grid-template-columns: 1fr; }
 }
@media (max-width: 720px) {
     h1 { font-size: 24px; }
     .nav { top: 6px; padding: 8px; }
     .nav #logoutBtn { margin-left: 0; }
     .nav a.btn.active::after { left: 10px; right: 10px; }
     .btn { min-height: 38px; }
     .actions { align-items: flex-start; }
     .actions-split { justify-content: flex-start; }
     .actions-split > .btn,
     .actions-split > a.btn,
     .owner-header-actions > .btn {
         max-width: calc(100vw - 56px);
     }
     .row, .stats { grid-template-columns: 1fr; }
     .panel { padding: 16px; border-radius: 18px; }
     .auth-landing { margin-top: 24px; padding: 18px 16px; }
     .auth-actions {
         display: grid;
         grid-template-columns: 1fr;
         gap: 10px;
     }
     .auth-actions .btn {
         width: 100%;
         min-width: 0;
     }
     .section-head {
         flex-direction: column;
         align-items: stretch;
     }
     .section-head-actions > .btn,
     .section-head-actions > a.btn {
         width: 100%;
     }
 }
