:root {
    --bg: #101826;
    --surface: #1a2436;
    --surface-2: #243149;
    --line: #2f3e5a;
    --text: #eef2f8;
    --muted: #9aa8bf;
    --accent: #5eead4;
    --accent-ink: #06231f;
    --warn: #fbbf24;
    --danger: #f87171;
    --ok: #86efac;
    --radius: 14px;
    --nav-height: 60px;
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    padding: env(safe-area-inset-top) 0 calc(var(--nav-height) + env(safe-area-inset-bottom));
}

[hidden] {
    display: none !important;
}

main {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

h1 {
    font-size: 1.5rem;
    margin: 20px 0 12px;
}

h2 {
    font-size: 1.1rem;
    margin: 20px 0 8px;
}

a {
    color: var(--accent);
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    border-radius: 10px;
    padding: 10px 16px;
    background: var(--surface-2);
}

.button-primary {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.button-quiet {
    background: transparent;
    color: var(--muted);
}

input,
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
}

label {
    display: block;
    margin: 12px 0 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ---- Shell: banners -------------------------------------------------------------------------- */

#shell-status {
    max-width: 640px;
    margin: 0 auto;
    padding: 8px 16px 0;
    display: grid;
    gap: 8px;
}

.banner {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 0.95rem;
}

.banner-action {
    border-color: var(--warn);
    color: var(--warn);
}

.banner-warning {
    border-color: var(--danger);
    color: var(--danger);
}

.banner-warning button {
    display: block;
    margin-top: 8px;
}

/* ---- Shell: capture -------------------------------------------------------------------------- */

#capture-shell {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 28px 0 8px;
}

.mic {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    padding: 0;
    background: var(--accent);
    color: var(--accent-ink);
    display: grid;
    place-items: center;
    box-shadow: 0 10px 30px rgb(94 234 212 / 25%);
    transition: transform 0.12s ease, background 0.12s ease;
}

.mic:active {
    transform: scale(0.96);
}

.mic svg {
    width: 56px;
    height: 56px;
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 1.8;
}

.mic.recording {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 0 0 10px rgb(248 113 113 / 22%);
}

.capture-status {
    min-height: 1.5em;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

.capture-latest {
    width: 100%;
    text-align: left;
}

.capture-latest p {
    margin: 0 0 6px;
}

.transcript {
    font-size: 1.05rem;
}

.transcript:empty {
    display: none;
}

/* ---- Shell: version and update --------------------------------------------------------------- */

/* The version of the running app is one quiet line under the navigation entries, on every screen.
   Its row is reserved, so nothing moves when the shell fills it in. */
#shell-nav {
    grid-template-rows: minmax(0, 1fr) 1rem;
}

#shell-nav .app-version {
    grid-area: 2 / 1 / 3 / -1;
    justify-self: center;
    padding: 0 16px;
    font-size: 0.65rem;
    font-weight: 400;
    line-height: 1rem;
    white-space: nowrap;
    opacity: 0.75;
}

#update-banner:disabled {
    cursor: default;
    opacity: 0.8;
}

/* ---- Shell: navigation ----------------------------------------------------------------------- */

#shell-nav {
    position: fixed;
    inset: auto 0 0;
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--line);
}

#shell-nav a {
    display: grid;
    place-items: center;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

#shell-nav a.current {
    color: var(--accent);
}

/* ---- Shell: dialog --------------------------------------------------------------------------- */

dialog {
    width: min(92vw, 420px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    padding: 20px;
}

dialog::backdrop {
    background: rgb(0 0 0 / 60%);
}

dialog h2 {
    margin-top: 0;
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.form-error {
    color: var(--danger);
    margin: 10px 0 0;
}

/* ---- App ------------------------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 10px 0;
}

.muted {
    color: var(--muted);
}

.link-list {
    display: grid;
    gap: 8px;
}

.link-list a {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.list-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

a.button-primary {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
}

.item-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.item-list li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}

.item-list li a {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
}

.item-list li .muted {
    grid-column: 1;
    font-size: 0.9rem;
}

.item-list li button {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.capture-history h2 {
    margin-top: 28px;
}

.capture-row audio {
    grid-column: 1 / -1;
    width: 100%;
    height: 36px;
    margin-top: 6px;
}

.row-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
}

.editor .check {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--text);
}

.editor .check input {
    width: auto;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    inset: auto 0 calc(var(--nav-height) + env(safe-area-inset-bottom));
    padding: 10px 16px;
    background: #7f1d1d;
    color: #fff;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* ---- Habits ---- */

.habit-strip h2 {
    margin-top: 12px;
}

.habit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.habit-row-name {
    flex: 1 1 12ch;
}

.habit-choices {
    display: flex;
    gap: 6px;
}

.habit-choice {
    padding: 8px 12px;
    border: 1px solid var(--line);
}

.habit-choice[aria-pressed="true"] {
    color: var(--accent-ink);
    font-weight: 600;
}

.habit-choice-kept[aria-pressed="true"] {
    background: var(--ok);
    border-color: var(--ok);
}

.habit-choice-not-kept[aria-pressed="true"] {
    background: var(--danger);
    border-color: var(--danger);
}

.habit-row .form-error {
    flex-basis: 100%;
    margin: 0;
}

.habit h2,
.habit-form h2 {
    margin: 0 0 2px;
}

.habit-facts {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.habit-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: 0 0 10px;
}

.habit-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 5px;
}

.habit-day {
    display: block;
    aspect-ratio: 1;
    min-width: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: transparent;
}

.habit-day-kept {
    border-color: var(--ok);
    background: var(--ok);
}

/* Not kept carries a stroke as well, so it does not depend on telling red from green. */
.habit-day-not_kept {
    border-color: var(--danger);
    background: linear-gradient(135deg, var(--danger) 42%, var(--surface) 42%, var(--surface) 58%, var(--danger) 58%);
}

.habit-day-not_scheduled {
    border-style: dashed;
    opacity: 0.35;
}

button.habit-day[aria-pressed="true"] {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.habit-day-editor,
.habit-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.habit-actions {
    gap: 2px;
}

.habit-actions button {
    padding: 6px 10px;
}

.habit-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.habit-legend .habit-day {
    width: 14px;
    margin-left: 8px;
}

.habit-weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 12px 0 0;
    padding: 0;
    border: 0;
}

.habit-weekdays legend {
    margin-bottom: 4px;
    padding: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.habit-weekdays label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.habit-weekdays input {
    width: auto;
}

/* ---- Settings ---- */

.settings-section h2 {
    margin-top: 0;
}

.settings-section p {
    margin: 6px 0;
}

.settings-section [role="status"]:empty {
    display: none;
}

.field-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 12px;
    align-items: end;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 16px;
}

.inline-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.inline-form > div {
    flex: 1;
}

.form-ok {
    color: var(--ok);
}

.error-list {
    padding-left: 20px;
}

.plain-list {
    list-style: none;
    margin: 8px 0;
    padding: 0;
}

.plain-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.plain-list li:first-child {
    border-top: 0;
}

.checklist li {
    justify-content: flex-start;
}

.checklist input {
    width: 22px;
    height: 22px;
    flex: none;
    accent-color: var(--accent);
}

.checklist label {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
}

.facts {
    margin: 8px 0;
}

.facts > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.facts > div:first-child {
    border-top: 0;
}

.facts dt {
    color: var(--muted);
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.table-scroll {
    overflow-x: auto;
}

.measurements {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.measurements th,
.measurements td {
    padding: 8px 6px;
    border-top: 1px solid var(--line);
    text-align: right;
    white-space: nowrap;
}

.measurements th:first-child {
    text-align: left;
    white-space: normal;
    font-weight: 400;
}

.measurements thead th {
    border-top: 0;
    color: var(--muted);
    font-weight: 400;
}

.measurements th .muted {
    display: block;
    font-size: 0.8rem;
}

/* ---- Review and search ---- */

#shell-nav {
    grid-template-columns: repeat(4, 1fr);
}

#shell-nav a {
    grid-auto-flow: column;
    justify-content: center;
    gap: 6px;
}

.nav-badge {
    min-width: 1.4em;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--warn);
    color: var(--accent-ink);
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
}

.review-entry h3 {
    margin: 0 0 2px;
    font-size: 1.05rem;
}

.review-question {
    margin: 0 0 4px;
    font-weight: 600;
}

.review-facts,
.review-detail {
    margin: 0 0 6px;
    font-size: 0.9rem;
}

.review-mark {
    color: var(--warn);
    font-weight: 600;
}

.review-entry audio {
    width: 100%;
    height: 36px;
    margin: 6px 0;
}

.review-choices,
.review-exits,
.review-defer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.review-edit {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin: 10px 0 0;
}

.review-defer {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.review-defer label {
    flex-basis: 100%;
    margin: 4px 0 0;
}

.review-defer input {
    flex: 1 1 14ch;
    width: auto;
}

.review-done {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--ok);
}

.review-done span {
    flex: 1 1 12ch;
}

.review-more,
.review-open {
    margin: 8px 0 0;
}

.review-stale li > span:first-child {
    font-weight: 600;
}

.review-stale .row-actions a {
    color: var(--accent);
    font-weight: 400;
    text-decoration: underline;
}

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0 8px;
    align-items: center;
    margin-bottom: 12px;
}

.search label {
    grid-column: 1 / -1;
    margin-top: 0;
}

.search-results {
    margin-bottom: 16px;
}

/* ---- Loading: the content area while the Blazor runtime downloads and starts ------------------- */

/* In the normal flow of the content area, below the capture panel: it can cover nothing. The fill follows
   the percentage Blazor maintains; the sheen says "still busy" while that number does not move. */
.app-loading {
    padding: 18px 0 6px;
}

.app-loading-bar {
    position: relative;
    height: 3px;
    border-radius: 2px;
    background: var(--surface-2);
    overflow: hidden;
}

.app-loading-fill {
    height: 100%;
    width: var(--blazor-load-percentage, 0%);
    background: var(--accent);
    transition: width 0.2s ease;
}

.app-loading-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgb(94 234 212 / 45%), transparent);
    animation: app-loading-sheen 1.4s linear infinite;
}

@keyframes app-loading-sheen {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(400%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-bar::after {
        animation: none;
    }
}

.app-loading p {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

/* ---- Undo toast and the quiet error line ------------------------------------------------------- */

/* Above the navigation bar. Rail and toast let taps through; only the Undo button takes them, so the toast
   can never be in the way of the capture button. */
.toast-rail {
    position: fixed;
    inset: auto 0 calc(var(--nav-height) + env(safe-area-inset-bottom) + 10px);
    z-index: 900;
    display: flex;
    justify-content: center;
    padding: 0 16px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(100%, 420px);
    padding: 8px 8px 8px 14px;
    border-radius: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgb(0 0 0 / 45%);
}

.toast-text {
    flex: 1 1 auto;
    min-width: 0;
    padding: 6px 0;
    overflow-wrap: anywhere;
}

.toast-undo {
    flex: none;
    pointer-events: auto;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 600;
}

.error-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 10px 0 0;
    padding: 6px 6px 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.error-line span {
    flex: 1 1 14ch;
}

/* ---- Today and the agenda ------------------------------------------------------------------------ */

.today-day {
    margin: -6px 0 0;
}

.today-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.today-list > li {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}

.today-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-width: 0;
}

.today-time {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.today-title {
    min-width: 0;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.today-list .muted {
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.today-list .row-actions,
.snooze-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

/* The quiet actions of a row are outlined, so they read as buttons and line up with the text above. */
.today-list .row-actions .button-quiet {
    border: 1px solid var(--line);
}

.snooze-choices button {
    text-align: left;
}

.snooze-choices small {
    display: block;
    color: var(--muted);
}

.tag {
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

.tag-overdue {
    border-color: var(--danger);
    color: var(--danger);
}

.tag-due_today {
    border-color: var(--warn);
    color: var(--warn);
}

.today-hint,
.today-shopping {
    margin: 8px 0 0;
}

/* An occurrence that does not take place stays visible, struck through (spec 9.2). */
.struck .agenda-title,
.struck .occurrence-label {
    color: var(--muted);
    text-decoration: line-through;
}

/* ---- Item editor: reminders, repeats, occurrences ---------------------------------------------- */

.editor-section {
    margin-top: 8px;
}

.schedule-status,
.repeat-summary {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.repeat-preview {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    overflow-wrap: anywhere;
}

.repeat-preview:empty {
    display: none;
}

.repeat-change {
    margin-top: 12px;
}

.repeat-change ul {
    margin: 6px 0;
    padding-left: 20px;
}

.editor-section .dialog-actions,
.editor-section .row-actions {
    flex-wrap: wrap;
}

.occurrence-label {
    font-weight: 600;
}

.occurrence-move {
    display: grid;
    gap: 4px;
}

.occurrence-move label {
    margin: 6px 0 0;
}
/* ---- Long words (tests/browser/layout.spec.js) ---- */

/* A title is a spoken phrase and may be one long word - a German compound, a link. It breaks inside
   the word instead of widening the page, which would push the fixed navigation off the screen. */
main {
    overflow-wrap: break-word;
}

/* In a row the column of the text may become narrower than its longest word; the button keeps its place. */
.item-list li {
    grid-template-columns: minmax(0, 1fr) auto;
}

.habit-row-name,
.plain-list li > :first-child {
    min-width: 0;
}

/* ---- Categories and the sections of a list (tests/browser/category-*.spec.js) ---- */

/* The heading of a section is the category or the person, with the number of its items beside it. A long
   name breaks inside the word; the count keeps its place. */
.list-section h2 {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.section-name,
.category-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.section-count {
    flex: none;
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 400;
}

.category-name {
    font-weight: 600;
}

/* Rename and merge open inside the card of their category. The column may become narrower than the longest
   word in it: a refusal quotes the name, and a name can be sixty characters without a space. */
.category-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    padding-top: 6px;
    border-top: 1px solid var(--line);
}

.category-form label {
    margin-top: 6px;
}

.category-form p {
    margin: 8px 0 0;
}

.category-list .row-actions .button-quiet {
    border: 1px solid var(--line);
}
/* ---- Capture: the results of a recording and the history (spec 4.4, 4.5, 5.3) ------------------ */

/* The same entries in the card of the latest recording (filled by shell/capture-view.js) and in every
   row of the history (Components/CaptureResults.razor). */
.capture-headline {
    margin: 0;
    font-weight: 600;
}

/* A title may be one long word (tests/browser/capture-layout.spec.js): every column here may become
   narrower than its longest word, so the word breaks instead of widening the page - also in the capture
   panel of the shell, whose card shows the same results. */
#capture-shell,
.capture-results,
.capture-list {
    grid-template-columns: minmax(0, 1fr);
}

.capture-results {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.capture-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    align-items: start;
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.capture-result > * {
    grid-column: 1;
    min-width: 0;
}

.capture-result > .capture-undo {
    grid-column: 2;
    grid-row: 1 / span 2;
    border: 1px solid var(--line);
}

.capture-result-title {
    font-weight: 600;
}

.capture-kind {
    margin-right: 6px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

a.capture-result-name {
    color: var(--text);
}

.capture-result-status {
    font-size: 0.95rem;
}

.capture-values,
.capture-detail {
    color: var(--muted);
    font-size: 0.9rem;
}

.capture-values {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
}

.capture-value {
    min-width: 0;
}

/* Spec 5.3: "default" and "assumed" are quiet, "needs review" stands out. */
.mark {
    margin-left: 4px;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.75rem;
    white-space: nowrap;
}

.mark-needs-review,
.tag-review {
    border-color: var(--warn);
    color: var(--warn);
}

.capture-result > .tag {
    justify-self: start;
    margin-top: 2px;
    text-decoration: none;
}

/* What was undone stays visible (spec 4.4): struck through, with the status line saying so. */
.outcome-undone .capture-result-name {
    color: var(--muted);
    text-decoration: line-through;
}

.outcome-undone .capture-values,
.outcome-undone .capture-detail {
    opacity: 0.6;
}

.outcome-waiting .capture-result-status {
    color: var(--warn);
}

.capture-latest > button {
    margin-top: 10px;
}

.capture-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.capture-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: center;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
}

.capture-row > * {
    grid-column: 1 / -1;
    min-width: 0;
}

/* A recording that is still on this phone: its text on the left, Discard on the right. */
.capture-local > .capture-headline,
.capture-local > .capture-facts {
    grid-column: 1;
}

.capture-local > button {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.capture-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0 6px;
    font-size: 0.9rem;
}

.capture-note::before {
    content: "· ";
}

.capture-row .transcript {
    font-size: 1rem;
}

.capture-row .form-error {
    margin: 4px 0 0;
}

.capture-row audio {
    width: 100%;
    height: 36px;
    margin-top: 4px;
}

.capture-details > summary {
    padding: 4px 0;
    color: var(--accent);
    cursor: pointer;
}

.capture-details > button {
    margin-top: 10px;
}

.capture-urgent h2 {
    margin-top: 24px;
}

/* ---- The name of an instance beside the live one (shell/instance.js, tests/browser/instance-dev.spec.js) ---- */

/* The live app has no name and this stays hidden. A named instance - the test instance "DEV" - says so
   in a corner of every screen: in the flow of the page, so it lies on nothing, and sticky, so it stays in
   sight while the page scrolls. It never takes a tap from what scrolls under it. */
.instance-badge {
    position: sticky;
    top: calc(env(safe-area-inset-top) + 4px);
    z-index: 5;
    width: fit-content;
    margin: 4px 12px 0 auto;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--warn);
    color: #201400;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0.14em;
    pointer-events: none;
}
