:root {
  --ink: #122d30;
  --muted: #4f6869;
  --deep: #071d20;
  --teal: #006858;
  --teal-dark: #005247;
  --mint: #e6f4ed;
  --line: #d5e2dc;
  --paper: #f6f8f4;
  --white: #fff;
  --gold: #e4bd72;
  --danger: #8b281f;
  font-family: "Noto Sans Bengali", "Kohinoor Bangla", "Nirmala UI", "Vrinda", "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.6;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3, p, ol { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button, input { min-height: 44px; }
button { border: 0; border-radius: 12px; padding: .55rem 1rem; font-weight: 600; line-height: 1.6; }
input, textarea { display: block; width: 100%; min-width: 0; padding: .65rem .8rem; border: 1px solid #a7bdb4; border-radius: 11px; background: #fff; color: var(--ink); font-size: max(16px, 1rem); }
textarea { resize: vertical; line-height: 1.65; }
input:focus, textarea:focus { border-color: var(--teal); }
:focus-visible { outline: 3px solid #a96705; outline-offset: 2px; }
label { display: block; margin: 0 0 .4rem; font-weight: 600; }
::placeholder { color: #698079; opacity: 1; }
button:disabled { cursor: default; opacity: .58; }
.primary { background: var(--teal); color: white; }
.primary:hover:enabled { background: var(--teal-dark); }
.secondary { color: #155c50; background: #eff6f1; border: 1px solid #b3cec0; }
.secondary:hover:enabled { background: #e1eee6; }
.quiet { background: transparent; color: var(--teal-dark); text-decoration: underline; text-underline-offset: .22em; }
.quiet:hover:enabled { background: #eaf2ed; }
.wide { width: 100%; }
.muted, .field-note { color: var(--muted); }
.center-stage { min-height: 100vh; min-height: 100svh; padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); display: grid; place-items: center; background: radial-gradient(ellipse at 12% 14%, #153b39, #071c20 61%); }
.boot-card { text-align: center; color: white; }
.boot-card .brand-logo { margin: 0 auto .6rem; }
.boot-card .secondary { margin-top: 1rem; }
.auth-shell { width: min(100%, 780px); display: grid; grid-template-columns: 1fr 1.16fr; border-radius: 26px; overflow: hidden; background: #fff; box-shadow: 0 24px 80px #00100e59; border: 1px solid #638685; }
.auth-art { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; color: white; text-align: center; background: #001218; }
.gate-avatar { width: min(100%, 244px); aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.auth-identity h1 { font-size: 2.15rem; line-height: 1.4; }
.auth-identity h1 span { color: var(--gold); }
.auth-identity p { color: #c6d5d2; }
.auth-card { padding: 36px 32px; align-self: center; }
.auth-card h2 { font-size: 1.52rem; }
.auth-card form { margin-top: 22px; }
.auth-card input { margin-bottom: .95rem; }
.auth-card .primary { margin-top: .3rem; }
.brand-logo { display: block; width: 48px; height: 48px; border: 1px solid #486d68; border-radius: 14px; }
.section-head, .job-head { display: flex; gap: 8px 14px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.section-head { margin: 24px 0 14px; }
h2 { font-size: clamp(1.4rem, 3.6vw, 1.75rem); line-height: 1.5; }
h3 { font-size: 1.12rem; line-height: 1.55; }
.badge { font-size: .8rem; font-weight: 600; background: var(--mint); color: #1d5a4c; padding: 3px 10px; border-radius: 100px; }
.badge.paused { background: #f0eadd; color: #64502d; }
.notice, .error, .feedback { padding: .68rem .83rem; border-radius: 10px; font-size: .9rem; }
.notice { margin-bottom: 12px; background: #f6f0df; border: 1px solid #e3d6ae; color: #5c4e2c; }
.error, .feedback[data-kind="error"] { color: var(--danger); background: #fff0eb; border: 1px solid #f2cabe; }
.global { margin: 12px 0; }
.feedback { background: var(--mint); color: #15564a; margin-top: .75rem; }
.composer, .card, .row-card { background: white; border-radius: 16px; border: 1px solid var(--line); }
.composer-tools, .actions, .row-actions { display: flex; gap: 6px 8px; align-items: center; flex-wrap: wrap; }
.field-note { margin-top: .6rem; font-size: .82rem; }
.field-note:empty { display: none; }
.card { padding: clamp(16px, 3vw, 24px); }
.card .actions { margin-top: 12px; }
.list-heading { margin: 23px 0 10px; }
.stack { display: grid; gap: 9px; }
.row-card { padding: 14px 17px; }
.row-actions { margin-top: 6px; }
.row-actions button { font-size: .87rem; padding: 4px 10px; }
.row-actions button:first-child { margin-left: -7px; }
button.remove { color: #8a3227; }
.empty { color: var(--muted); padding: 13px 16px; border-radius: 12px; border: 1px dashed #b5c7bd; }
.job-card > .muted { margin: 5px 0 13px; }
.divider { border-top: 1px solid var(--line); margin: 20px 0 16px; }
.time-field { display: flex; align-items: center; gap: 12px; }
.time-field input { max-width: 175px; }
.time-field span, .run-time { color: var(--muted); font-size: .87rem; }
.job-result { margin-top: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  .auth-shell { max-width: 420px; grid-template-columns: 1fr; border-radius: 21px; }
  .auth-art { flex-direction: row; justify-content: flex-start; padding: 14px 20px; gap: 13px; text-align: left; }
  .gate-avatar { width: 76px; height: 76px; }
  .auth-identity h1 { font-size: 1.7rem; }
  .auth-card { padding: 22px 20px; }
  .section-head { margin: 18px 0 11px; }
}

.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 17px 0 5px; }
.list-toolbar button { font-size: .85rem; }
#next-run { margin-bottom: .5rem; }


.pickers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.file-picker { position: relative; overflow: hidden; cursor: pointer; margin: 0; padding: .48rem .8rem; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid #b3cec0; background: #eff6f1; color: #155c50; }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker:focus-within { outline: 3px solid #a96705; outline-offset: 2px; }
.selection { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 12px; }
.share-card { margin-top: 20px; }
.share-card label { margin-top: 10px; }
.link-button { display: inline-flex; justify-content: center; align-items: center; border-radius: 11px; font-weight: 600; padding: .5rem .8rem; min-height: 44px; text-decoration: none; margin-top: 8px; }
.row-actions a { display: inline-flex; align-items: center; min-height: 44px; font-size: .87rem; padding: 4px 7px; font-weight: 600; color: var(--teal-dark); text-underline-offset: .2em; }
@media (max-width: 360px) { .file-picker { padding-inline: .56rem; } }

/* Only the transcript (or the open secondary screen) scrolls inside the signed-in app. */
#workspace {
  position: fixed; inset-inline: 0; top: var(--viewport-top, 0px);
  height: 100vh; height: var(--available-height, 100dvh);
  display: flex; flex-direction: column; overflow: hidden;
  background: #fafbf7;
}
.topbar {
  flex: none; color: white; background: #0c2526;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
  border-bottom: 1px solid #9c9664;
}
.topbar-inner { width: min(100%, 1120px); margin: auto; padding: 10px 24px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; background: transparent; color: #f6fbf6; text-align: start; }
.brand-copy { display: grid; gap: 3px; }
.brand-name { font-size: 1.35rem; line-height: 1.2; font-weight: 700; }
.brand-name b { color: var(--gold); }
.brand-sub { color: #c2d1c9; font-size: .73rem; line-height: 1.25; font-weight: 400; }
.brand .brand-logo { width: 44px; height: 44px; border-radius: 13px; }
.menu-toggle { display: inline-flex; align-items: center; gap: 9px; border: 1px solid #526c64; background: transparent; color: #f7fbf7; padding-inline: 13px; font-size: .92rem; }
.menu-toggle:hover { background: #173a36; }
.menu-lines { width: 14px; height: 8px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.desk { display: flex; flex-direction: column; flex: 1 1 0; width: 100%; min-height: 0; overflow: hidden; }
.desk > .global, #state-retry { flex: none; align-self: center; max-width: min(100%, 780px); }
.desk > .global { margin: 4px 12px; }
.panel:not(#chat-panel) {
  flex: 1 1 0; width: 100%; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 max(calc((100% - 760px)/2), 16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(calc((100% - 760px)/2), 16px, env(safe-area-inset-left));
}
#chat-panel { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; width: min(100%, 920px); margin: 0 auto; }
#chat-scroll {
  flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto;
  overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #bdcbc3 transparent;
  padding: 20px max(24px, env(safe-area-inset-right)) 14px max(24px, env(safe-area-inset-left));
}
#chat-scroll:focus-visible { outline-offset: -4px; }
.welcome {
  flex: none; margin: auto 0; padding: 18px 8px; text-align: center; align-self: center;
  display: grid; justify-items: center; gap: 5px;
}
.welcome img { display: block; width: 87px; height: 87px; margin-bottom: 14px; border-radius: 24px; box-shadow: 0 10px 28px #073e2b1c, 0 0 0 7px #eeefe6; }
.welcome h3 { font-size: clamp(1.65rem, 4vw, 2.5rem); font-weight: 650; line-height: 1.45; letter-spacing: -.018em; }
.welcome p { color: var(--muted); font-size: 1rem; }
.messages { list-style: none; flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 17px; padding: 0; }
.messages:empty { display: none; }
.bubble { position: relative; max-width: min(92%, 720px); min-width: 10rem; padding: 12px 16px 14px; background: #fff; border: 1px solid #dfe6dd; border-radius: 4px 20px 20px 20px; }
.bubble.mine { align-self: flex-end; background: #e4f1e8; border-color: #d3e4d6; border-radius: 20px 4px 20px 20px; }
.bubble strong { display: block; color: #526e61; padding-right: 45px; font-size: .78rem; line-height: 1.6; margin-bottom: 5px; }
.bubble p { color: #1e3330; line-height: 1.8; }
.bubble-share { position: absolute; right: 6px; top: 0; min-height: 42px; font-size: .75rem; padding: 6px 8px; color: #526e61; }
.pending-entry { display: flex; flex-direction: column; flex: none; margin-top: 17px; }
.typing { margin: 12px 5px 2px; color: var(--muted); font-size: .87rem; }
.typing span { margin-right: 5px; letter-spacing: 1px; font-size: .55em; color: #33897b; }
.compose-dock {
  flex: none; max-height: 55%; overflow-y: auto; padding: 9px max(24px, env(safe-area-inset-right)) max(15px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: #fafbf7;
}
.setup-line { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1px 8px; color: #655536; font-size: .86rem; }
.setup-line button { min-height: 44px; padding: 4px 6px; background: transparent; color: #695526; font-size: inherit; text-decoration: underline; text-underline-offset: .22em; }
.composer { margin: 0; padding: 10px 13px; background: white; border: 1px solid #bdcfc3; border-radius: 21px; box-shadow: 0 5px 18px #2b51440b; }
.composer:focus-within { border-color: #518875; }
.composer textarea { min-height: 35px; max-height: 110px; resize: none; border: 0; border-radius: 7px; padding: 4px 6px; line-height: 1.65; }
.composer textarea:focus-visible { outline: 0; }
.composer-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 4px; }
.more-tools, .voice { min-height: 44px; border: 1px solid #d4e0d5; color: #295e4f; background: #f3f7f1; }
.more-tools { font: 500 1.35rem/1 system-ui, sans-serif; width: 44px; padding: 0; border-radius: 50%; }
.voice { padding: 3px 12px; border-radius: 24px; font-size: .9rem; }
.voice[data-stage="recording"] { color: #8a352e; background: #fcf0e9; border-color: #eac7bc; }
.send { margin-inline-start: auto; min-width: 82px; padding: 6px 15px; border-radius: 23px; }
.send span { font: 600 1.12rem/1 system-ui, sans-serif; }
.compose-dock .field-note { text-align: center; font-size: .77rem; line-height: 1.45; margin-top: 7px; }
.compose-dock .feedback { margin: 6px 0 0; font-size: .83rem; padding: 5px 9px; }
.settings-card p { margin: 8px 0 12px; }
.settings-card code { display: block; padding: 10px 14px; border-radius: 10px; background: #eaf1e9; color: #234738; overflow-wrap: anywhere; }
#nav-dialog {
  color: var(--ink); background: #fbfcf8; border: 1px solid #c6d9ca; border-radius: 22px;
  width: min(calc(100vw - 28px), 340px); max-height: min(84vh, 650px); max-height: min(84dvh, 650px);
  padding: 16px; margin: auto; box-shadow: 0 18px 70px #132e2a40; overflow-y: auto;
}
#nav-dialog::backdrop { background: #05232270; }
.menu-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 10px; }
.menu-head h2 { font-size: 1.25rem; }
.menu-close { width: 44px; font: 1.5rem/1 system-ui,sans-serif; color: var(--ink); background: #eaf0e9; }
.menu-list { display: grid; gap: 3px; }
.menu-list button, .menu-logout { width: 100%; text-align: start; background: transparent; color: #2e5145; border-radius: 10px; }
.menu-list button[aria-current] { color: #164f3e; background: #e0eee3; }
.menu-list button:hover, .menu-logout:hover { background: #e8f1e8; }
.menu-logout { margin-top: 9px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: #764e38; }
@media (max-width: 600px) {
  .topbar-inner { padding: 8px 14px; }
  .brand .brand-logo { width: 40px; height: 40px; border-radius: 12px; }
  .brand-name { font-size: 1.22rem; }
  #chat-scroll { padding: 14px max(13px, env(safe-area-inset-right)) 10px max(13px, env(safe-area-inset-left)); }
  .compose-dock { padding: 5px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .composer { border-radius: 18px; padding: 8px 10px; }
  .welcome img { width: 72px; height: 72px; border-radius: 21px; }
  .bubble { max-width: 93%; }
  #nav-dialog { margin: auto auto max(12px, env(safe-area-inset-bottom)); }
}
@media (max-height: 500px) {
  .topbar-inner { padding-block: 3px; }
  .welcome img { width: 48px; height: 48px; border-radius: 14px; margin-bottom: 4px; }
  .welcome { padding-block: 6px; }
  .compose-dock { padding-block-start: 2px; }
  .compose-dock .field-note { margin-top: 3px; }
  .setup-line { line-height: 1.25; }
}

.settings-card details { margin-bottom: 10px; }
.settings-card summary { cursor: pointer; padding-block: 9px; color: var(--teal-dark); font-weight: 600; }

.bubble p, .item-copy, .job-result { white-space: pre-wrap; overflow-wrap: anywhere; }
.voice { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mic-symbol { position: relative; display: inline-block; width: 16px; height: 18px; flex: none; background: linear-gradient(currentColor, currentColor) center 13px/2px 4px no-repeat, linear-gradient(currentColor, currentColor) center bottom/8px 2px no-repeat; }
.mic-symbol::before { content: ""; position: absolute; top: 0; left: 5px; width: 6px; height: 11px; border-radius: 5px; background: currentColor; }
.mic-symbol::after { content: ""; position: absolute; top: 6px; left: 2px; width: 12px; height: 8px; border: 1.5px solid currentColor; border-top: 0; border-radius: 0 0 7px 7px; }
