/*
 * base.css — app-level bridges on top of nocturne.css.
 * Nocturne (loaded first) already sets the dark palette, Inter, the
 * component classes (.btn, .seg, .card, .table, .dialog, .input …) and the
 * :focus-visible ring. This file keeps only the guards the app still needs
 * and a few element defaults Nocturne doesn't cover.
 */

/* Components below (and Nocturne) set explicit `display`, which would
   otherwise defeat the `hidden` attribute. Restore it, the normalize.css way. */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    margin: 0;
    padding: 0;
    /* A single overlong token (raw pasted URL) must never scroll the page. */
    overflow-x: hidden;
    width: 100%;
    /* No overscroll-behavior here: with overflow-x hidden on both, body is
       a scroll container, and Firefox for Android stops touch scrolling
       when it can't hand the gesture on to the page. */
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-tap-highlight-color: transparent;
}

a { color: var(--color-accent-300); text-decoration: none; }

/* Touch has no hover: browsers fake one on tap and leave it stuck, so every
   :hover rule in the app sits behind this query; touch gets :active. */
@media (hover: hover) and (pointer: fine) {
    a:hover { color: var(--color-accent-200); }
}

/* Controls fire on tap without the double-tap-zoom wait, and a long press
   doesn't select their label or pop the link callout. Content links stay
   selectable. */
button, a, [role="button"], .seg-opt, .radio {
    touch-action: manipulation;
}
button, [role="button"], .seg-opt, .radio {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Native controls follow the dark ground (date-picker icon, scrollbars). */
:root {
    color-scheme: dark;
    /* Go / Caution / No-go. The no-go red is too dark for small text on a
       card (3.9:1), so text takes the lighter shade (6.3:1). */
    --color-go: #35b06a;
    --color-caution: #e0bb4a;
    --color-no-go: #d9575a;
    --color-no-go-text: #ef8a8c;
}

/* Larger tap targets for the touch build without disturbing Nocturne's
   compact desktop sizing. */
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn-icon { width: 44px; height: 44px; }
    .seg-opt, .context-chip { min-height: 44px; }
    /* Under 16px, iOS zooms the page into a focused field and stays zoomed. */
    .input, input, select, textarea { font-size: 16px; }
}

.hint {
    font-size: 12px;
    color: var(--color-neutral-500);
    margin: 0;
}

.form-error {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-no-go-text);
}

/* Utility: a Nocturne faded rule as a standalone element. */
.rule {
    height: 1px;
    border: 0;
    background: linear-gradient(to right,
        transparent, var(--color-divider) 48px,
        var(--color-divider) calc(100% - 48px), transparent);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
