/* arinu portal. Brand: Petrov Sans titles (when installed), Helvetica text, Paper and Plum. */
@font-face { font-family: "Petrov Sans"; src: local("Petrov Sans"), local("PetrovSans-Regular"); }
:root {
  --paper: #F4F4F4; --white: #FFFFFF; --ink: #262626; --slate: #5E5E5E;
  --plum: #3B2A60; --plum-light: #4A3778; --violet: #6B3FD6; --wash: #EFEAFC; --lilac: #C49BF2;
  --line: #DCD8E4; --ember: #B8360A; --tangerine: #FF8C42; --teal: #2B8A7F;
  --title: "Petrov Sans", Helvetica, Arial, sans-serif;
  --text: Helvetica, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--title); font-weight: 400; color: var(--plum); margin: 0; line-height: 1.15; }
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
header { background: var(--white); border-bottom: 1px solid var(--line); }
header .bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
header img { height: 30px; }
main .wrap { display: grid; gap: 1.5rem; padding-block: 1.75rem 4rem; }
.card { background: var(--white); border-radius: 18px; padding: 1.5rem; display: grid; gap: 0.75rem; }
.muted { color: var(--slate); }
.error { color: var(--violet); } /* Ember is kept for emergencies */
button { font: inherit; font-family: var(--title); border: 0; border-radius: 999px; padding: 0.8rem 1.4rem; background: var(--plum); color: var(--white); cursor: pointer; justify-self: start; }
button:hover { background: var(--violet); }
button.quiet { background: transparent; color: var(--plum); box-shadow: inset 0 0 0 1.5px var(--plum); padding: 0.45rem 1rem; }
.sections { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.section { background: var(--white); border-radius: 16px; padding: 1.1rem 1.2rem; display: grid; gap: 0.25rem; }
.section h3 { font-size: 1.15rem; }
.section .soon { font-size: 0.8rem; color: var(--violet); }


/* navigation: scrolls sideways on a phone */
nav { display: flex; gap: 0.25rem; overflow-x: auto; padding-block: 0 0.6rem; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav a { flex: none; color: var(--slate); text-decoration: none; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.95rem; }
nav a:hover { color: var(--plum); background: var(--wash); }
nav a.on { color: var(--white); background: var(--plum); }

.stack { display: grid; gap: 1.25rem; }
.head { display: grid; gap: 0.35rem; }
.head p { margin: 0; max-width: 60ch; }
.small { font-size: 0.85rem; }
h2 { font-size: 1.35rem; }
a.section { text-decoration: none; color: inherit; border: 1.5px solid transparent; }
a.section:hover { border-color: var(--lilac); }

/* forms */
.form { display: grid; gap: 1rem; }
.form .grid { display: grid; gap: 0.9rem 1.2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.field { display: grid; gap: 0.3rem; align-content: start; }
.field > span { font-size: 0.9rem; color: var(--slate); }
.field.long, .field.list, .field.check { grid-column: 1 / -1; }
.field.check small.error { flex-basis: 100%; }
.form .hint { margin: 0 0 0.75rem; }
.req { color: var(--violet); font-weight: 400; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px; padding: 0.6rem 0.75rem; width: 100%; min-height: 2.75rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); background: var(--white); }
.field small.error { font-size: 0.85rem; }
.form-error { margin: 0; }
.form-error:empty { display: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
button:disabled { opacity: 0.6; cursor: default; }
.saved { font-size: 0.9rem; color: var(--teal); }

/* record lists */
.kind { display: grid; gap: 0.75rem; }
.kind + .kind { margin-top: 1rem; }
.kind-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.list { display: grid; }
.empty { margin: 0; }
.item { display: flex; gap: 1rem; justify-content: space-between; align-items: start; padding: 0.85rem 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0.25rem; }
.item-main { display: grid; gap: 0.2rem; min-width: 0; }
.item h3 { font-size: 1.1rem; }
.item p { margin: 0; overflow-wrap: anywhere; }
.item .note { font-size: 0.95rem; white-space: pre-line; }
.item-actions { display: flex; gap: 0.25rem; flex: none; }
button.link { background: none; color: var(--plum); padding: 0.3rem 0.5rem; font-family: var(--text); font-size: 0.9rem; }
button.link:hover { background: var(--wash); }
button.link.danger { color: var(--slate); }
.editing { background: var(--wash); margin-block: 0.5rem; }
.card .card.editing { border-radius: 14px; }

/* lab charts */
.charts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.lab { margin: 0; }
.lab figcaption { display: grid; gap: 0.2rem; }
.lab figcaption p { margin: 0; }
.flag { color: var(--tangerine); }
.chart { width: 100%; height: auto; display: block; font-family: var(--text); }
.chart .band { fill: var(--wash); }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .trend { fill: none; stroke: var(--plum); stroke-width: 2.5; stroke-linejoin: round; }
.chart .dot { fill: var(--plum); stroke: var(--white); stroke-width: 2; }
.chart .dot.out { fill: var(--tangerine); }
.chart .tick { fill: var(--slate); font-size: 15px; }
.chart .label { fill: var(--ink); font-size: 16px; }

@media (max-width: 560px) {
  .card { padding: 1.1rem; border-radius: 14px; }
  .item { flex-direction: column; gap: 0.4rem; }
}
/* talk */
.talk-link { justify-self: start; text-decoration: none; font-family: var(--title); background: var(--plum); color: var(--white); border-radius: 999px; padding: 0.8rem 1.4rem; }
.talk-link:hover { background: var(--violet); }
.talk-card { justify-items: center; text-align: center; gap: 1rem; padding-block: 2rem; }
.talk-button { justify-self: center; width: 9.5rem; height: 9.5rem; border-radius: 50%; padding: 0; font-size: 1.4rem; display: grid; place-items: center; box-shadow: 0 0 0 0 var(--lilac); transition: box-shadow 0.3s, background 0.3s; }
.talk-button[data-mode="busy"], .talk-button[data-mode="listening"], .talk-button[data-mode="speaking"] { background: var(--violet); }
.talk-button[data-mode="busy"] span, .talk-button[data-mode="listening"] span, .talk-button[data-mode="speaking"] span { font-size: 0; }
.talk-button[data-mode="busy"] span::after, .talk-button[data-mode="listening"] span::after, .talk-button[data-mode="speaking"] span::after { content: "Stop"; font-size: 1.4rem; }
.talk-button[data-mode="listening"] { animation: listen 2.4s ease-in-out infinite; }
.talk-button[data-mode="speaking"] { box-shadow: 0 0 0 14px var(--wash); }
@keyframes listen { 50% { box-shadow: 0 0 0 14px var(--wash); } }
@media (prefers-reduced-motion: reduce) { .talk-button[data-mode="listening"] { animation: none; box-shadow: 0 0 0 8px var(--wash); } }
.talk-state { margin: 0; font-family: var(--title); color: var(--plum); font-size: 1.15rem; }
.check { display: flex; gap: 0.5rem; align-items: center; color: var(--slate); font-size: 0.95rem; text-align: left; }
.check input { width: 1.2rem; height: 1.2rem; min-height: 0; flex: none; }
.talk-card input[type="text"] { max-width: 28rem; }
.transcript { display: grid; gap: 0.6rem; max-height: 55vh; overflow-y: auto; }
.transcript p { margin: 0; }
.said b { display: block; font-family: var(--title); font-weight: 400; font-size: 0.85rem; color: var(--slate); }
.said.arinu b { color: var(--violet); }
.said.note { color: var(--slate); font-size: 0.85rem; text-align: center; }
.demo { display: grid; justify-items: center; gap: 0.4rem; border-top: 1px solid var(--line); padding-top: 1rem; width: 100%; }
.demo p { margin: 0; }
button.fall { justify-self: center; }
/* Ember is reserved for emergencies; the fall banner is the one place it appears. */
.alert { display: grid; gap: 0.2rem; width: 100%; text-align: left; border-radius: 12px; padding: 0.9rem 1rem; border-left: 6px solid var(--slate); background: var(--paper); }
.alert strong { font-family: var(--title); font-weight: 400; font-size: 1.15rem; }
.alert.checking { border-color: var(--tangerine); }
.alert.sent { border-color: var(--ember); background: #FBEDE7; }
.alert.sent strong { color: var(--ember); }
.alert.ok { border-color: var(--teal); }
/* import review */
.item.pick, .item.pick:first-child { flex-direction: row; justify-content: flex-start; gap: 0.8rem; cursor: pointer; }
.item.pick input { width: 1.25rem; height: 1.25rem; min-height: 0; flex: none; margin-top: 0.2rem; }
.tag { font-size: 0.85rem; color: var(--violet); }
input[type="file"] { background: none; border: 0; padding: 0.4rem 0; }
[hidden] { display: none !important; }

/* Calendar: the next two weeks, one block per day */
.day { padding: 0.6rem 0; border-top: 1px solid var(--line); }
.day:first-of-type { border-top: 0; }
.day h3 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.day .when { display: inline-block; min-width: 5.5rem; font-weight: 700; }

/* sign-in card: email form */
#email-form { gap: 0.75rem; }
#email-form label { display: grid; gap: 0.3rem; font-size: 0.95rem; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
