/* meetup@istaa — mobile-first, plain CSS. Palette and rules follow instructions/DesignInstructions.md. */

:root {
    --ink: #1A1A1A;
    --ink-soft: #5B5B5B;
    --paper: #FFFFFF;
    --paper-soft: #F7F7F5;
    --line: #E4E4E1;
    --accent: #F9AE42;
    --accent-dark: #C97F1E;
    --accent-text: #8A5200;      /* darker amber for small text on white (AA contrast) */
    --success: #54B4AE;
    --danger: #E1493A;
    --danger-text: #A93226;      /* darker red for text on white (AA contrast) */
    --highlight: #F7EA2F;
    --footer-dark: #1A1A1A;
    --font: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --sidebar-width: 240px;
    --nav-height: 60px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--paper);
}

h1, h2, h3, p, ul, ol, figure, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
img { max-width: 100%; }

a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }

.muted { color: var(--ink-soft); font-size: 14px; }
.center { text-align: center; }
.hint { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.static { padding: 10px 0; }

/* ── Typography ─────────────────────────────────────────────────────────── */
.page-title { font-size: 22px; font-weight: 600; line-height: 1.25; }
.section-title { font-size: 17px; font-weight: 500; margin-bottom: 8px; }
.subsection-title { font-size: 15px; font-weight: 500; margin: 14px 0 6px; }
.page-head { margin-bottom: 20px; }
.page-head .muted { margin-top: 4px; }
.prose { white-space: normal; }
.back-link { display: inline-block; padding: 8px 0; text-decoration: none; }

/* ── Brand ──────────────────────────────────────────────────────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__logo { display: block; height: 32px; width: auto; }
.brand__app { font-size: 14px; color: var(--ink-soft); }

/* ── Shell ──────────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.content {
    max-width: 1040px;
    margin: 0 auto;
    padding: 20px 16px calc(var(--nav-height) + 40px);
}

.sidebar { display: none; }

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: flex;
    height: var(--nav-height);
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--footer-dark);
}

.bottom-nav a {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 13px;
    text-decoration: none;
    border-top: 3px solid transparent;
}

.bottom-nav a.is-active { color: var(--accent); border-top-color: var(--accent); font-weight: 500; }

.bottom-nav .badge-dot {
    position: absolute;
    top: 12px;
    left: calc(50% + 24px);
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--highlight);
}

.badge-dot { background: var(--highlight); color: var(--ink); font-size: 12px; font-weight: 600; border-radius: 10px; padding: 0 7px; }

.link-button {
    background: none;
    border: 0;
    padding: 8px 0;
    font: inherit;
    color: var(--accent-text);
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    min-height: 44px;
}

@media (min-width: 900px) {
    .shell { display: grid; grid-template-columns: var(--sidebar-width) 1fr; align-items: start; }
    .topbar, .bottom-nav { display: none; }
    .content { width: 100%; padding: 32px 40px 60px; }

    .sidebar {
        position: sticky;
        top: 0;
        display: flex;
        flex-direction: column;
        height: 100vh;
        padding: 24px 20px;
        border-right: 1px solid var(--line);
        background: var(--paper-soft);
    }
    .sidebar__area { margin: 14px 0 20px; font-size: 13px; color: var(--ink-soft); }
    .sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
    .sidebar__nav a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        color: var(--ink);
        text-decoration: none;
        border-left: 3px solid transparent;
    }
    .sidebar__nav a:hover { background: var(--paper); }
    .sidebar__nav a.is-active { border-left-color: var(--accent); font-weight: 600; background: var(--paper); }
    .sidebar__foot { margin-top: auto; display: flex; flex-direction: column; font-size: 13px; color: var(--ink-soft); }
    .sidebar__foot strong { color: var(--ink); font-weight: 500; }
    .sidebar__foot .link-button { align-self: flex-start; }
}

/* ── Auth screens ───────────────────────────────────────────────────────── */
.auth-layout { background: var(--paper-soft); }
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 32px 20px;
    background: var(--paper);
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-container .brand { margin-bottom: 8px; }
@media (min-width: 520px) {
    .auth-container { margin-top: 48px; min-height: 0; border: 1px solid var(--line); padding: 32px 28px; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--ink);
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}
.btn:hover { background: var(--paper-soft); color: var(--ink); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--ink); }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #FFFFFF; }
.btn--danger { border-color: var(--danger); color: var(--danger-text); }
.btn--danger:hover { background: var(--danger); color: #FFFFFF; }
.btn--block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.actions form { display: flex; gap: 10px; margin: 0; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; min-width: 0; border: 0; }
.field label, .field legend { font-weight: 500; margin-bottom: 6px; padding: 0; }
.field-row { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }

input[type="text"], input[type="email"], input[type="password"], input[type="search"],
input[type="number"], input[type="date"], input[type="time"], input[type="file"], select, textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #B9B9B4;
    border-radius: 4px;
    background: var(--paper);
    color: var(--ink);
    font: inherit;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dark); outline-offset: 1px; border-color: var(--accent-dark); }

.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error-text { color: var(--danger-text); font-size: 13px; margin-top: 4px; }

.choice { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-weight: 400 !important; min-height: 44px; }
.choice input { margin-top: 5px; flex-shrink: 0; }
.choice .hint { display: block; margin: 0 0 0 4px; }

.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.toolbar__row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 520px) { .toolbar__row { grid-template-columns: 1fr 1fr; } }
.toolbar .actions { margin: 0; }

.sticky-action { position: sticky; bottom: calc(var(--nav-height) + 8px); padding: 12px 0; background: var(--paper); }
@media (min-width: 900px) { .sticky-action { position: static; } }

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash { padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); border-left: 4px solid var(--ink-soft); background: var(--paper-soft); }
.flash--success { border-left-color: var(--success); }
.flash--error { border-left-color: var(--danger); }
.flash--warning { border-left-color: var(--accent); }

/* ── Lists, cards, status ───────────────────────────────────────────────── */
.list > li { border-bottom: 1px solid var(--line); padding: 14px 0; }
.attendee { display: flex; flex-direction: column; gap: 10px; }
.attendee__main { display: flex; gap: 12px; color: inherit; text-decoration: none; }
.attendee__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.attendee__name { font-weight: 500; font-size: 16px; }
.attendee__action { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-left: 52px; }
@media (min-width: 700px) {
    .attendee { flex-direction: row; align-items: center; justify-content: space-between; }
    .attendee__action { padding-left: 0; justify-content: flex-end; }
}

.avatar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--ink);
    border-radius: 50%;
    font-size: 13px;
    font-weight: 500;
    background: var(--paper-soft);
}
.avatar--large { width: 56px; height: 56px; font-size: 17px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { padding: 1px 8px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; color: var(--ink-soft); background: var(--paper-soft); }

.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-soft); flex-shrink: 0; }
.status--success::before { background: var(--success); }
.status--pending::before { background: var(--accent); }
.status--danger::before { background: var(--danger); }
.status--muted::before { background: #B9B9B4; }

.profile-hero { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; }
.profile-section { padding: 14px 0; border-top: 1px solid var(--line); }

.empty { padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 12px 0 20px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.panel { margin: 28px 0; padding: 20px 0 0; border-top: 1px solid var(--line); }
.room-row { margin: 16px 0; padding: 16px; border: 1px solid var(--line); background: var(--paper-soft); }

.notice { margin: 16px 0 24px; padding: 16px; border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--paper-soft); }
.notice--warning { border-left-color: var(--danger); }
.plain-list { margin: 8px 0; }
.plain-list li { padding: 6px 0; border-top: 1px solid var(--line); }

section + section { margin-top: 24px; }

/* ── Meetings ───────────────────────────────────────────────────────────── */
.day { margin-bottom: 8px; }
.meeting { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.meeting__time { flex: 0 0 76px; display: flex; flex-direction: column; }
.meeting__time strong { font-size: 17px; font-weight: 600; }
.meeting__body { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; min-width: 0; }
.meeting__with { font-weight: 500; font-size: 16px; }
.meeting__place { font-size: 14px; }
.meeting .actions { margin-bottom: 0; }

.slot-day { border: 0; margin-bottom: 20px; }
.slot-day legend { font-weight: 500; margin-bottom: 10px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slot-option { position: relative; }
.slot-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border: 1px solid #B9B9B4;
    border-radius: 4px;
    cursor: pointer;
    background: var(--paper);
}
.slot-option label:hover { border-color: var(--ink); }
.slot-option input:checked + label { background: var(--accent); border-color: var(--accent); font-weight: 600; }
.slot-option input:focus-visible + label { outline: 2px solid var(--accent-dark); outline-offset: 2px; }

/* ── Tables (cards on mobile, table on desktop) ─────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; margin: 12px 0 24px; }
.data-table th { text-align: left; font-weight: 500; color: var(--ink-soft); font-size: 13px; padding: 8px 10px; border-bottom: 1px solid var(--ink); }
.data-table td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline-flex; }
.row-actions .btn { margin: 2px 4px 2px 0; }

@media (max-width: 899px) {
    .responsive thead { position: absolute; left: -9999px; }
    .responsive, .responsive tbody, .responsive tr, .responsive td { display: block; width: 100%; }
    .responsive tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .responsive td { padding: 4px 0; border: 0; }
    .responsive td[data-label]::before { content: attr(data-label); display: block; font-size: 12px; color: var(--ink-soft); }
    .responsive .row-actions { white-space: normal; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
}

/* ── Settings sub navigation, time windows, email templates ─────────────── */
.subnav { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.subnav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; text-decoration: none; color: var(--ink-soft); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subnav a:hover { color: var(--ink); }
.subnav a.is-active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.window-day { border: 0; border-top: 1px solid var(--line); padding: 12px 0; margin: 0; }
.window-day legend { font-weight: 500; padding: 0 0 6px; }
.window-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0; }
.window-row input[type="time"] { width: auto; min-width: 120px; }
.window-row .choice { min-height: 44px; padding: 0; }
.template-card { border-top: 1px solid var(--line); padding: 16px 0; }
.template-card textarea { font-family: inherit; }
.variable-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 8px 0; font-size: 14px; }
.variable-list dt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.variable-list dd { margin: 0; color: var(--ink-soft); }
.check-col { width: 44px; }
.check-col input { width: 20px; height: 20px; }
.select-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 12px 0; }

/* Request a meeting: every slot is shown, only free ones can be picked */
.slot-option input:disabled + label { cursor: not-allowed; flex-direction: column; font-size: 13px; line-height: 1.2; }
.slot-option input:disabled + label:hover { border-color: #B9B9B4; }
.slot-option--booked input:disabled + label { background: #FBE3E0; border-color: var(--danger); color: var(--danger-text); }
.slot-option--pending input:disabled + label { background: var(--line); border-color: var(--ink-soft); color: var(--ink-soft); }
.slot-option--busy input:disabled + label { background: var(--paper); border-style: dashed; color: var(--ink-soft); text-decoration: line-through; }
.slot-state { font-size: 11px; text-decoration: none; display: block; }
.slot-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 16px; font-size: 14px; }
.slot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.slot-legend i { display: inline-block; width: 16px; height: 16px; border-radius: 3px; border: 1px solid #B9B9B4; background: var(--paper); }
.slot-legend .legend--booked { background: #FBE3E0; border-color: var(--danger); }
.slot-legend .legend--pending { background: var(--line); border-color: var(--ink-soft); }
.slot-legend .legend--busy { border-style: dashed; }
/* Searchable attendee select */
.combo { position: relative; }
.combo__list { position: absolute; z-index: 10; top: 100%; left: 0; right: 0; max-height: 280px; overflow-y: auto; margin-top: 2px; background: var(--paper); border: 1px solid var(--ink); border-radius: 4px; }
.combo__list li { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: center; min-height: 44px; padding: 6px 12px; cursor: pointer; border-top: 1px solid var(--line); }
.combo__list li:first-child { border-top: 0; }
.combo__list li:hover, .combo__list li.is-active { background: var(--paper-soft); outline: 2px solid var(--accent); outline-offset: -2px; }
.combo__list li[hidden] { display: none; }
.combo__empty { padding: 8px 0; }
/* Instructions */
.help-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.help-toc a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; color: var(--ink); }
.help-toc a:hover { border-color: var(--ink); }
.help { max-width: 760px; scroll-margin-top: 16px; }
.help .slot-legend { flex-direction: column; }
.help code { background: var(--paper-soft); padding: 1px 5px; border-radius: 3px; }
@media (max-width: 400px) { .bottom-nav a { font-size: 11.5px; min-width: 0; padding: 0 1px; } }
/* Navigation item shown as an icon (help "?") */
.nav-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1.5px solid currentColor; border-radius: 50%; font-weight: 600; font-size: 15px; line-height: 1; }
.bottom-nav a.nav-icon-link { flex: 0 0 56px; }