:root {
  color-scheme: dark;
  font-family: "Instrument Sans", system-ui, sans-serif;
  color: #f0f9ff;
  background: #081725;
  line-height: 1.5;
  --surface: #10293b;
  --edge: #426b7d;
  --muted: #b8d0dd;
  --teal: #a1f5f2;
}
.owner-dock { display:flex; justify-content:center; gap:8px; padding:12px; border-top:1px solid var(--edge); background:#0c2333; }
.owner-dock a { display:flex; flex-direction:column; align-items:center; gap:4px; min-height:48px; min-width:82px; padding:5px; text-decoration:none; font-size:.8rem; color:var(--muted); }
.owner-dock svg { width:22px; height:22px; }
.owner-dock a:hover,.owner-dock a:focus-visible { color:var(--teal); background:#17394d; border-radius:8px; }
.assistant-summary { border-left:3px solid var(--teal); padding:16px; background:var(--surface); border-radius:12px; }
.assistant-overview { margin:0 0 12px; }
.assistant-overview p { margin-bottom:6px; color:var(--muted); font-size:.92rem; }
.assistant-overview .assistant-connection-status { color:var(--teal); font-weight:650; }
.assistant-settings,.assistant-history { color:var(--muted); font-size:.9rem; margin-block:12px; }
.assistant-filters { display:flex; flex-wrap:wrap; gap:8px; margin-block:18px 12px; }
.assistant-filters a { display:flex; gap:8px; align-items:center; min-height:44px; padding:8px 12px; text-decoration:none; border:1px solid var(--edge); border-radius:10px; }
.assistant-filters a[aria-current] { background:var(--teal); color:#082934; font-weight:650; }
.assistant-filters span { font-size:.85em; opacity:.8; }
.assistant-new { border-bottom:1px solid var(--edge); padding-bottom:10px; margin-bottom:16px; }
.assistant-card { padding:18px; box-shadow:none; }
.assistant-card h2 { font-size:1.2rem; line-height:1.35; margin-block:14px; overflow-wrap:anywhere; }
.assistant-card-meta { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; }
.assistant-card-meta time { font-size:.76rem; color:var(--muted); }
.assistant-badge { display:inline-flex; align-items:center; padding:4px 9px; border:1px solid #567b8a; border-radius:20px; font-size:.78rem; font-weight:650; }
.assistant-card[data-status=running] .assistant-badge { color:#a1f5f2; background:#133d48; border-color:#39878d; }
.assistant-card[data-status=blocked] .assistant-badge { color:#ffe2aa; background:#3a2c19; border-color:#99743e; }
.assistant-card[data-status=done] .assistant-badge { color:#b5edc8; background:#173d2c; border-color:#568c6a; }
.assistant-card[data-status=cancelled] .assistant-badge { color:#b8c7cc; background:#243440; }
.assistant-next { background:#0c2637; border-left:3px solid var(--teal); border-radius:6px; padding:10px 12px; margin-bottom:12px; }
.assistant-next strong { color:var(--muted); font-size:.8rem; }
.assistant-next p { font-size:.95rem; margin:4px 0 0; }
.assistant-progress { font-size:.9rem; color:var(--muted); }
.assistant-description,.assistant-edit { border-top:1px solid #426b7d70; padding-top:4px; }
.assistant-description p { white-space:pre-wrap; }
.assistant-description h3 { font-size:.9rem; margin-top:12px; }
.assistant-warning { padding:10px; border-radius:8px; background:#3a2c19; color:#ffe2aa; font-size:.9rem; }
.assistant-empty { padding:24px 12px; text-align:center; color:var(--muted); }
@media(max-width:480px) { .assistant-card { padding:14px; } .assistant-filters { gap:6px; } .assistant-filters a { flex:1; justify-content:center; padding-inline:8px; font-size:.82rem; } }
@media(max-width:600px) {
 body:has(.owner-dock) { padding-bottom:calc(90px + env(safe-area-inset-bottom)); }
 .owner-dock { position:fixed; bottom:0; left:0; right:0; z-index:10; gap:0; justify-content:space-around; padding:8px 2px calc(8px + env(safe-area-inset-bottom)); }
 .owner-dock a { min-width:0; flex:1; font-size:.67rem; }
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 85% 0%, #16485c, transparent 44rem), #081725; }
a { color: var(--teal); text-underline-offset: .2em; }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid #a5f8fc; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(100% - 32px, 920px); margin-inline: auto; }
.masthead { background: linear-gradient(110deg, #081725, #12394d); border-bottom: 1px solid var(--edge); box-shadow: 0 4px 24px #45e6ef1c; }
.brand, .brand a { display: flex; align-items: center; gap: 12px; }
.brand { min-height: 76px; justify-content: space-between; }
.brand a { text-decoration: none; color: var(--muted); font-size: .82rem; }
.brand img { flex: none; border-radius: 12px; box-shadow: 0 0 16px #61eff54a; }
.brand strong { display: block; color: #f0f9ff; font-size: 1.05rem; }
.skip { position: absolute; transform: translateY(-150%); padding: 8px; background: var(--surface); }
.skip:focus { transform: translateY(0); z-index: 1; }
main { padding-block: clamp(24px, 5vw, 48px) 48px; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); margin: 0 0 20px; line-height: 1.12; letter-spacing: -.03em; }
h2 { font-size: 1.23rem; margin: 0 0 12px; }
h2 small { color: var(--teal); margin-left: .3em; }
h3 { margin: 0 0 8px; }
p { margin: 0 0 12px; overflow-wrap: anywhere; }
aside { padding: 10px 14px; margin-bottom: 20px; border: 1px solid #906c39; border-radius: 12px; color: #ffe3af; background: #382b1d; font-size: .9rem; }
.sections, .quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.sections a, .quick-actions a, button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 15px; border-radius: 12px; border: 1px solid var(--edge); text-decoration: none; font-weight: 650; }
.sections a, .quick-actions a, button.quiet { background: linear-gradient(#193e50, #102839); color: #e6f7fa; box-shadow: inset 0 1px #bdf9ff1f; }
button, .sections a[aria-current], .quick-actions a.primary { background: linear-gradient(#b9ffff, #54e1e6 65%, #36c3d0); border-color: #a5f8fc; color: #072531; box-shadow: 0 0 18px #49e9fa44, inset 0 1px #e0ffff; cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
main > section { margin-block: 24px; }
article, .sign-in, main > section#new { background: linear-gradient(145deg, #17394d, #10283a 75%); border: 1px solid var(--edge); border-radius: 18px; padding: clamp(14px, 3vw, 22px); margin-bottom: 12px; box-shadow: 0 8px 22px #020d194d, inset 0 1px #c3f9ff16; }
.sign-in { max-width: 480px; }
main form { margin-block: 12px; }
label { display: block; color: var(--muted); margin-block: 12px; }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; margin-top: 5px; padding: 10px 12px; background: #081d2d; color: #f0f9ff; border: 1px solid #5e899a; border-radius: 9px; }
input[type=checkbox] { accent-color: #6decf0; }
textarea { resize: vertical; }
summary { cursor: pointer; color: var(--teal); padding-block: 9px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 480px) {
  .sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sections a { padding-inline: 6px; text-align: center; }
  .quick-actions a { justify-content: flex-start; width: 100%; }
}



.overview-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(135px,1fr)); gap:10px; margin:20px 0; }
.overview-grid a { display:flex; flex-direction:column; gap:6px; background:var(--surface); border:1px solid var(--edge); border-radius:12px; padding:16px; text-decoration:none; }
.overview-grid strong { font-size:1.8rem; }
.service-summary { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:12px; }
section[id^="queue-"] { scroll-margin-top:20px; }
@media(min-width:1200px) {
 body:has(.owner-dock) { padding-left:160px; }
 .owner-dock { position:fixed; inset:0 auto 0 0; width:160px; flex-direction:column; justify-content:flex-start; padding-top:90px; border-right:1px solid var(--edge); }
 .owner-dock a { flex-direction:row; justify-content:flex-start; gap:12px; padding:14px; }
}

.owner-release { color:var(--muted); font-size:.78rem; padding-block:24px; }
.owner-draft-notice,#owner-session-warning { border:1px solid #99743e; padding:12px; border-radius:10px; color:#ffe2aa; background:#3a2c19; }


/* Large text can move logout to a second row without clipping the brand. */
.brand{flex-wrap:wrap;padding-block:12px}
.brand>a{flex:1 1 12rem;min-width:0;max-width:100%}
.brand>a span{min-width:0;overflow-wrap:anywhere}
.brand form{max-width:100%;margin-inline-start:auto}
h1,h2,h3,h4,h5,h6{overflow-wrap:anywhere;word-break:break-word}
.brand strong{word-break:break-word}
.skip{max-width:calc(100% - 32px);overflow-wrap:anywhere;word-break:break-word}
@media(max-width:600px){
 .owner-dock{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:start}
 .owner-dock a{width:100%;min-width:0}
 .owner-dock span{max-width:100%;overflow-wrap:anywhere;text-align:center}
}


button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
/* Long Russian words in navigation and consent labels must reflow at 200%. */
label,summary,.sections a,.quick-actions a,.owner-dock span{overflow-wrap:anywhere;word-break:break-word}
.sections a,.quick-actions a{min-width:0;max-width:100%;white-space:normal}

/* Style the closed control while retaining the native select/picker. WebKit's
   platform popup renderer otherwise contributes its longest option to page overflow. */
:root select{
 appearance:none;-webkit-appearance:none;min-width:0;max-width:100%;padding-inline-end:2rem;overflow:hidden;text-overflow:ellipsis;
 background-image:linear-gradient(45deg,transparent 50%,var(--teal,#a1f5f2) 50%),linear-gradient(135deg,var(--teal,#a1f5f2) 50%,transparent 50%);
 background-position:calc(100% - 18px) 50%,calc(100% - 12px) 50%;background-size:6px 6px;background-repeat:no-repeat;
}
