/* Neko-tail shared tokens, 2026-10-12. System fonts and local assets only. */
:root {
  --neko-bg:#f7f8fa; --neko-panel:#fff; --neko-subtle:#f0f4f3;
  --neko-ink:#263c3f; --neko-muted:#64787b; --neko-line:#e2e8e8;
  --neko-line-strong:#c4d2cf; --neko-accent:#267166; --neko-accent-hover:#1c5c53;
  --neko-soft:#eaf3ef; --neko-on-accent:#fff; --neko-strong:#263c3f;
  --neko-shadow:0 12px 36px #193d3514;
  --danger:#a43d3d; --danger-bg:#fcf0ef; --warning:#826020; --warning-bg:#fbf3df;
  color-scheme:light;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC","Noto Sans JP","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:14px; line-height:1.75; color:var(--neko-ink); background:var(--neko-bg);
}
:root[data-neko-theme=dark] {
  --neko-bg:#141d20; --neko-panel:#1d282c; --neko-subtle:#233237;
  --neko-ink:#dfebe6; --neko-muted:#a3b4b4; --neko-line:#2c3b3f;
  --neko-line-strong:#465f61; --neko-accent:#a4d5c2; --neko-accent-hover:#bfe5d6;
  --neko-soft:#263e38; --neko-on-accent:#173b32; --neko-strong:#101a1e;
  --neko-shadow:0 12px 36px #00000033;
  --danger:#f0b2aa; --danger-bg:#3d292b; --warning:#e8cd90; --warning-bg:#373225;
  color-scheme:dark;
}
@media(prefers-color-scheme:dark) {
  :root:not([data-neko-theme=light]) {
    --neko-bg:#141d20; --neko-panel:#1d282c; --neko-subtle:#233237;
    --neko-ink:#dfebe6; --neko-muted:#a3b4b4; --neko-line:#2c3b3f;
    --neko-line-strong:#465f61; --neko-accent:#a4d5c2; --neko-accent-hover:#bfe5d6;
    --neko-soft:#263e38; --neko-on-accent:#173b32; --neko-strong:#101a1e;
    --neko-shadow:0 12px 36px #00000033;
    --danger:#f0b2aa; --danger-bg:#3d292b; --warning:#e8cd90; --warning-bg:#373225;
    color-scheme:dark;
  }
}
* {box-sizing:border-box}
[hidden] {display:none!important}
body {margin:0; background:var(--neko-bg)}
a {color:var(--neko-accent); text-underline-offset:4px}
a:hover {color:var(--neko-accent-hover)}
button,input,select,textarea {font:inherit; color:inherit}
button,a,input,select,textarea,summary {transition:background-color 160ms,border-color 160ms,color 160ms}
:focus-visible {outline:2px solid var(--neko-accent); outline-offset:4px}
main:focus {outline:none}
button,.button {display:inline-flex; align-items:center; justify-content:center; gap:8px; border:1px solid transparent; border-radius:7px; background:var(--neko-accent); color:var(--neko-on-accent); padding:9px 16px; min-height:42px; font-weight:600; text-decoration:none; cursor:pointer; width:fit-content; line-height:1.5}
button:hover,.button:hover {background:var(--neko-accent-hover); color:var(--neko-on-accent)}
.secondary {background:var(--neko-panel); border-color:var(--neko-line-strong); color:var(--neko-ink)}
.secondary:hover {background:var(--neko-subtle); color:var(--neko-accent)}
.danger {background:var(--danger-bg); color:var(--danger); border-color:var(--danger)}
.danger:hover {background:var(--danger-bg); color:var(--danger)}
button:disabled,input:disabled,select:disabled,textarea:disabled {opacity:.58; cursor:not-allowed}
input,select,textarea {display:block; width:100%; min-width:0; max-width:100%; background:var(--neko-panel); border:1px solid var(--neko-line-strong); border-radius:7px; padding:10px 12px; line-height:1.5; margin-top:6px}
input::placeholder,textarea::placeholder {color:var(--neko-muted); opacity:1}
input[type=checkbox],input[type=radio] {width:auto; display:inline-block; accent-color:var(--neko-accent)}
textarea {resize:vertical; min-height:100px}
label {display:block; font-size:13px; font-weight:550; margin:0}
form {display:grid; gap:16px; margin:0}
form + form {margin-top:20px}
h1,h2,h3,p {margin:0}
h1 {font-size:25px; font-weight:650; line-height:1.4; letter-spacing:-.5px; overflow-wrap:anywhere}
h2 {font-size:17px; font-weight:650; line-height:1.5; margin:0 0 14px}
h3 {font-size:15px; font-weight:650}
p {color:var(--neko-muted); margin:8px 0 18px; overflow-wrap:anywhere}
strong {font-weight:650}
section,article,aside {min-width:0}
section {margin-bottom:20px}
main>section,main>.cards>section,.layout>section,.layout>aside {background:var(--neko-panel); border:1px solid var(--neko-line); border-radius:12px; padding:24px}
article {border:1px solid var(--neko-line); border-radius:10px; padding:20px; background:var(--neko-panel); margin-bottom:14px}
article h2,article h3 {overflow-wrap:anywhere}
article:last-child {margin-bottom:0}
.icon {flex-shrink:0; vertical-align:middle}
.eyebrow {font-size:11px; font-weight:600; letter-spacing:1.7px; color:var(--neko-muted); margin:0 0 10px}
.hint {font-size:13px; color:var(--neko-muted); line-height:1.75; font-weight:400}
.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}
.skip-link {position:fixed; top:-100px; left:16px; z-index:20; padding:10px 18px; background:var(--neko-panel); border:1px solid var(--neko-accent); border-radius:7px}
.skip-link:focus {top:12px}
.brand {display:flex; align-items:center; gap:11px; text-decoration:none; color:var(--neko-ink); font-size:17px; font-weight:650; white-space:nowrap; line-height:1.4}
.brand small {display:block; font-size:9px; letter-spacing:1.9px; font-weight:500; color:var(--neko-muted); margin-top:3px}
.workspace {display:grid; grid-template-columns:224px minmax(0,1fr); min-height:100vh}
.sidebar {position:sticky; top:0; height:100vh; border-right:1px solid var(--neko-line); background:var(--neko-panel); padding:28px 20px 20px; display:flex; flex-direction:column}
.sidebar .brand {padding:0 10px 26px}
.workspace-menu {padding:0; border:0; margin:0; display:flex; flex:1; flex-direction:column; min-height:0; background:none}
.workspace-menu>summary {display:none}
.sidebar-content {display:flex; flex-direction:column; min-height:0; height:calc(100dvh - 122px); overflow-y:auto; padding:0 2px}
.nav-label {margin:12px 12px 10px; font-size:12px; color:var(--neko-muted)}
.sidebar nav {display:grid; gap:6px}
.sidebar nav a {display:flex; gap:11px; align-items:center; padding:11px 12px; border-radius:7px; color:var(--neko-muted); text-decoration:none}
.sidebar nav a:hover {background:var(--neko-subtle); color:var(--neko-ink)}
.sidebar nav a[aria-current] {background:var(--neko-soft); color:var(--neko-accent); font-weight:600}
.sidebar-bottom {margin-top:auto; padding-top:28px}
.sidebar-account {border-top:1px solid var(--neko-line); padding:22px 4px 16px; display:flex; align-items:center; gap:10px}
.sidebar-account>div {min-width:0}
.sidebar-account strong {display:block; overflow-wrap:anywhere; font-size:13px}
.sidebar-account small {display:block; color:var(--neko-muted); font-size:12px}
.avatar {display:grid; place-items:center; width:34px; height:34px; border-radius:9px; background:var(--neko-soft); color:var(--neko-accent); flex-shrink:0}
.logout {width:100%; font-size:13px; min-height:38px}
.portal-link {font-size:13px; text-decoration:none; color:var(--neko-muted)}
.sidebar .portal-link {display:flex; justify-content:space-between; align-items:center; padding:20px 5px 0}
.workspace-body {min-width:0; display:flex; flex-direction:column}
.topbar,.public-header {display:flex; align-items:center; justify-content:space-between; gap:16px; min-height:74px; padding:16px 36px; background:var(--neko-panel); border-bottom:1px solid var(--neko-line)}
.service-name {display:flex; align-items:center; gap:12px; font-size:13px; color:var(--neko-muted)}
.service-name strong {font-size:17px; color:var(--neko-ink); letter-spacing:.5px}
.service-name>span {border-left:1px solid var(--neko-line); padding-left:12px}
.theme-toggle {font-size:12px; min-height:38px; padding:8px 11px; white-space:nowrap}
.theme-toggle .icon {width:17px; height:17px}
.theme-sun {display:none}
[data-neko-theme=dark] .theme-sun {display:inline-flex}
[data-neko-theme=dark] .theme-moon {display:none}
main {padding:34px 36px 48px; width:100%; max-width:1440px; margin:0 auto; flex:1; min-width:0}
.page-heading {margin-bottom:28px}
.page-heading .eyebrow {margin-bottom:6px}
.page-heading>p:last-child {margin:9px 0 0; font-size:14px}
footer {font-size:12px; color:var(--neko-muted); padding:20px 36px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-top:1px solid var(--neko-line)}
footer span {color:var(--neko-muted)}
.heading,.section-title {display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px}
.layout {display:grid; grid-template-columns:minmax(0,1fr) minmax(280px,360px); gap:24px; align-items:start}
.cards {display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr)); gap:16px; margin-bottom:24px}
.cards>section,.cards>article {margin:0}
.pair {display:grid; grid-template-columns:1fr 1fr; gap:14px}
.actions {display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.badge,.status {display:inline-block; font-size:12px; padding:3px 9px; background:var(--neko-subtle); border:1px solid var(--neko-line); border-radius:5px; white-space:nowrap; font-weight:500}
.status-success {color:var(--neko-accent); background:var(--neko-soft)}
.status-warning {color:var(--warning); background:var(--warning-bg)}
.empty {padding:36px 24px; text-align:center; border:1px dashed var(--neko-line-strong); border-radius:10px; color:var(--neko-muted); background:var(--neko-panel); margin-bottom:20px}
.empty h2 {color:var(--neko-ink); font-size:16px; margin:0 0 8px}
.empty p {margin:0 0 12px}
[role=alert] {padding:16px 20px; background:var(--danger-bg); color:var(--danger); border:1px solid var(--danger); border-radius:8px; margin-bottom:24px; overflow-wrap:anywhere}
[role=alert] p {color:inherit}
[aria-busy=true] {cursor:progress}
.htmx-request {opacity:.65}
details {border:1px solid var(--neko-line); border-radius:10px; background:var(--neko-panel); padding:16px 20px; margin:16px 0}
summary {cursor:pointer; font-weight:600; color:var(--neko-ink); min-height:28px}
details[open]>summary {margin-bottom:16px}
pre,code,textarea[name=contract],textarea[name=data] {font-family:ui-monospace,"SFMono-Regular",Consolas,monospace; font-size:13px}
pre {white-space:pre-wrap; overflow-wrap:anywhere; background:var(--neko-subtle); border:1px solid var(--neko-line); padding:20px; border-radius:8px}
dl {display:grid; grid-template-columns:90px minmax(0,1fr); gap:6px; font-size:13px}
dt {color:var(--neko-muted)}
dd {margin:0; overflow-wrap:anywhere}
.audit {list-style:none; padding:0; font-size:13px}
.audit li {display:flex; flex-wrap:wrap; justify-content:space-between; border-bottom:1px solid var(--neko-line); padding:12px 0; gap:12px; overflow-wrap:anywhere}
.audit span {color:var(--neko-muted)}
@media(min-width:901px) {
  .workspace-menu:not([open])>.sidebar-content {display:flex}
  .workspace-menu::details-content {content-visibility:visible; display:block}
}
@media(max-width:1100px) {
  .workspace {grid-template-columns:208px minmax(0,1fr)}
  main {padding:28px 24px 40px}
  .topbar {padding-inline:24px}
  .layout {grid-template-columns:1fr}
}
@media(max-width:900px) {
  .workspace {display:block}
  .sidebar {position:static; height:auto; padding:16px 24px; border-right:0; border-bottom:1px solid var(--neko-line)}
  .sidebar .brand {padding:0 0 12px; width:fit-content}
  .workspace-menu {display:block; flex:none}
  .workspace-menu>summary {display:flex; align-items:center; gap:10px; padding:8px 0; min-height:44px; list-style:none; font-size:13px; width:fit-content}
  .workspace-menu>summary::-webkit-details-marker {display:none}
  .workspace-menu[open]>summary {margin-bottom:0}
  .sidebar-content {height:auto; overflow:visible; padding-top:4px}
  .sidebar nav {grid-template-columns:1fr 1fr}
  .sidebar-bottom {padding:0; margin:0}
  .sidebar-account {border:0; padding-top:16px}
  .sidebar .logout {width:fit-content}
  .sidebar .portal-link {width:fit-content; gap:10px; padding-top:16px}
  .nav-label {display:none}
  .topbar {min-height:62px; padding-block:12px}
}
@media(max-width:560px) {
  main {padding:24px 18px 36px}
  .topbar,.public-header {padding-inline:18px}
  .sidebar {padding:16px 18px 8px}
  h1 {font-size:23px}
  .page-heading {margin-bottom:24px}
  main>section,main>.cards>section,.layout>section,.layout>aside {padding:20px}
  .layout {gap:16px}
  .pair {grid-template-columns:1fr}
  .heading {align-items:flex-start; flex-wrap:wrap}
  footer {padding:20px 18px; flex-direction:column; align-items:flex-start; gap:4px}
  input,select,textarea {font-size:16px}
  .theme-toggle [data-theme-label] {display:none}
  .theme-toggle {min-width:42px; min-height:42px}
}
@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {transition:none!important; animation:none!important; scroll-behavior:auto!important}
}
/* Slightly stronger secondary text on grey surfaces; keep the shared palette. */
.page-heading>p,.group-heading p,footer,footer span,.filter-bar [role=status],
.contract-intro p,main>p,.list-toolbar p,th,.hint {
  color:color-mix(in srgb,var(--neko-muted) 90%,var(--neko-ink));
}
