/* Oracle — dark navy + gold, mobile-first, no horizontal scroll. */
:root {
  --navy: #0a1c30;
  --navy-2: #0e2438;
  --navy-3: #14304d;
  --gold: #d4af37;
  --gold-dim: #a9882a;
  --cream: #f5eedc;
  --ink: #e9e4d8;
  --muted: #9db2c6;
  --danger: #e88a7a;
  --ok: #8fd0a0;
  --line: #23405c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  background: var(--navy);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* header */
#app-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 10px 14px;
  background: var(--navy-2); border-bottom: 1px solid var(--gold-dim);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 7px; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 20px; color: var(--cream); letter-spacing: 0.4px; }
.user-box { display: flex; align-items: center; gap: 8px; min-width: 0; }
#user-photo { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--gold); }
#user-name { font-size: 13px; color: var(--muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#edit-name-btn { padding: 5px 9px; font-size: 12px; }
#edit-name-box { display: inline-flex; align-items: center; gap: 6px; }
#edit-name-input {
  background: var(--navy); color: var(--ink); border: 1px solid var(--line);
  border-radius: 9px; padding: 7px 10px; font-size: 14px; font-family: inherit; width: 150px;
}
#edit-name-input:focus { outline: 2px solid var(--gold-dim); outline-offset: 0; }
#edit-name-box .btn { padding: 6px 10px; font-size: 13px; }
#edit-name-error { font-size: 12px; }

/* buttons + fields */
.btn {
  border: 1px solid var(--line); background: var(--navy-3); color: var(--ink);
  border-radius: 9px; padding: 9px 14px; font-size: 14px; cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); border-color: var(--gold-dim); color: #191204; font-weight: 600; }
.btn-ghost { background: transparent; }
.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.6px; }
.field input, .field textarea, select, .composer textarea {
  width: 100%; background: var(--navy); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 15px;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, select:focus, .composer textarea:focus {
  outline: 2px solid var(--gold-dim); outline-offset: 0;
}

/* views */
main { flex: 1; display: flex; flex-direction: column; width: 100%; max-width: 760px; margin: 0 auto; }
.view { padding: 18px 14px 28px; }
.login-card { text-align: center; padding-top: 32px; }
.login-mark { width: 110px; height: 110px; border-radius: 22px; }
.login-card h1 { font-family: Georgia, serif; color: var(--cream); font-size: 34px; margin: 14px 0 6px; }
.tagline { color: var(--muted); margin: 0 auto 22px; max-width: 420px; line-height: 1.45; }
#gsi-button { display: flex; justify-content: center; min-height: 44px; }
.notice { color: var(--gold); font-size: 14px; }
.error-text { color: var(--danger); font-size: 14px; }
#mock-login { max-width: 340px; margin: 10px auto 0; text-align: left; }
#mock-login .btn { width: 100%; }

/* password login (sits above the Google button) */
.cred-form { max-width: 340px; margin: 0 auto; text-align: left; }
.cred-form .btn[type="submit"] { width: 100%; }
.mode-toggle { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }
.link-btn { background: none; border: none; color: var(--gold); cursor: pointer; font-size: 13px; padding: 0; text-decoration: underline; font-family: inherit; }
.divider {
  display: flex; align-items: center; gap: 10px;
  max-width: 340px; margin: 18px auto 14px;
  color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
#setpw-form .btn { margin-top: 8px; }

/* tabs */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 10px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--navy-2); color: var(--muted); font-size: 15px; cursor: pointer;
}
.tab.active { color: #191204; background: var(--gold); border-color: var(--gold-dim); font-weight: 600; }

/* chat */
.conv-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.conv-bar select { flex: 1; min-width: 0; }
.thread { display: flex; flex-direction: column; gap: 10px; padding-bottom: 12px; }
.bubble {
  max-width: 88%; padding: 10px 13px; border-radius: 14px; line-height: 1.45;
  font-size: 15px; white-space: pre-wrap; word-break: break-word;
}
.bubble.user { align-self: flex-end; background: var(--navy-3); border: 1px solid var(--line); }
.bubble.assistant { align-self: flex-start; background: var(--navy-2); border: 1px solid var(--gold-dim); }
.bubble.error { border-color: var(--danger); color: var(--danger); }
.bubble.thinking { color: var(--muted); font-style: italic; }
.composer { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: 10px; background: var(--navy); padding-top: 6px; }
.composer textarea { flex: 1; resize: none; }

/* jobs */
.job-form { background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.job-form .btn { width: 100%; }
.job-card { background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.job-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.job-title { font-weight: 600; color: var(--cream); word-break: break-word; }
.job-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.job-body { font-size: 14px; color: var(--ink); margin-top: 8px; white-space: pre-wrap; word-break: break-word; }
.chip { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.queued { color: var(--gold); border-color: var(--gold-dim); }
.chip.running { color: #7ec3e8; border-color: #2c5a7a; }
.chip.done { color: var(--ok); border-color: #2f5a3c; }
.chip.failed { color: var(--danger); border-color: #6e352b; }
.empty { color: var(--muted); text-align: center; padding: 26px 0; }

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* install banner — a slim bar under the header, never a modal */
.install-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--navy-2);
  border-bottom: 1px solid var(--gold-dim); color: var(--ink); font-size: 14px;
}
.install-banner .btn { margin-left: auto; }
.install-banner .btn + .btn { margin-left: 0; }

/* composer extras: mode select, dictation, attach, talk */
.composer-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.composer-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.composer-row select { width: auto; flex: 0 1 auto; padding: 7px 9px; font-size: 13px; }
.icon-btn { padding: 8px 10px; }
.icon-btn.active, #talk-btn.active { background: var(--gold); color: #191204; border-color: var(--gold-dim); font-weight: 600; }
.attach-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 6px 3px 10px; font-size: 12px; color: var(--ink); max-width: 100%;
}
.attach-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.attach-chip button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; padding: 0 2px; }

/* messages: sender names + listen button */
.msg { display: flex; flex-direction: column; }
.msg.user { align-items: flex-end; }
.msg.assistant { align-items: flex-start; }
.sender { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.speak-btn { background: none; border: none; cursor: pointer; font-size: 12px; padding: 2px 6px; color: var(--muted); font-family: inherit; }
.nb-chip { cursor: pointer; align-self: center; color: var(--gold); border-color: var(--gold-dim); }

/* talk panel */
.talk-panel { background: var(--navy-2); border: 1px solid var(--gold-dim); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.talk-status { font-size: 17px; color: var(--cream); font-weight: 600; cursor: pointer; }
.talk-heard { color: var(--muted); font-size: 14px; min-height: 20px; margin-top: 4px; white-space: pre-wrap; word-break: break-word; }
.talk-controls { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.talk-controls .field { flex: 1; margin-bottom: 0; min-width: 0; }

/* notebooks */
.section-title { color: var(--cream); font-family: Georgia, serif; margin: 18px 0 8px; font-size: 17px; font-weight: 600; }
.nb-card {
  display: block; width: 100%; text-align: left; font-family: inherit;
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer; color: var(--ink);
}
.nb-screen-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.nb-screen-head h2 { font-family: Georgia, serif; color: var(--cream); margin: 0; font-size: 22px; }
.src-item, .share-item {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--navy-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; margin-bottom: 8px;
}
.src-item .grow, .share-item .grow { flex: 1; min-width: 0; word-break: break-word; }
.src-kind { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gold); white-space: nowrap; padding-top: 2px; }
.mini { font-size: 12px; padding: 5px 9px; }
button:disabled { opacity: 0.5; cursor: default; }
