:root {
    color-scheme: light;
    font: 16px/1.5 "Inter", system-ui, sans-serif;
    color: #19222e;
    background: #eef0f3;
    --muted: #566171;
    --line: #d2d7df;
    --control-line: #8a95a5;
    --accent: #185adb;
    --accent-hover: #1246b1;
    --surface: #fff;
    --tint: #f0f4fb;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100svh;
    max-width: 66rem;
    margin: auto;
    padding: max(1rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
}

.app-header, .brand {
    display: flex;
    align-items: center;
}

.app-header {
    justify-content: space-between;
    gap: 1rem;
    padding: 0 0 1rem;
}

.brand { flex-shrink: 0; min-height: 2.25rem; color: var(--accent); font-size: 1.65rem; font-weight: 800; letter-spacing: -.055em; }
.header-note, footer { color: var(--muted); font-size: .875rem; }
.header-note { text-align: right; }

.brand-dots { display: inline-block; width: .85em; letter-spacing: 0; white-space: pre; }

.workspace {
    display: grid;
    flex: 1;
    grid-template-rows: 3rem 1fr;
    border: 1px solid var(--line);
    background: var(--surface);
}

.signal-panel {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--line);
    background: #f7f9fc;
}

.signal {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    height: 18px;
}

.signal::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 1rem;
    background: var(--line);
}

.signal i { flex-shrink: 0; width: 3px; height: 4px; background: var(--accent); }
.signal i:nth-child(2), .signal i:nth-child(8) { height: 8px; }
.signal i:nth-child(3), .signal i:nth-child(7) { height: 14px; }
.signal i:nth-child(4), .signal i:nth-child(6) { height: 8px; }
.signal i:nth-child(5) { height: 18px; }
.card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(1rem, 5vw, 2rem);
}

.card section {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.15rem); font-weight: 650; line-height: 1.1; letter-spacing: -.045em; }
.intro { margin: .8rem 0 0; color: var(--muted); }
.screen-heading { margin-bottom: 1.35rem; }
.screen-actions, .call-actions { margin-top: auto; }

button, input, select {
    appearance: none;
    min-height: 3.125rem;
    border: 1px solid var(--control-line);
    border-radius: 0;
    padding: .65rem .85rem;
    font: inherit;
    color: inherit;
    background: var(--surface);
}

button { font-weight: 600; cursor: pointer; background: var(--tint); transition: background .15s, border-color .15s; }
button:hover:not(:disabled) { border-color: var(--accent); background: #e5ebf5; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.primary { width: 100%; border-color: var(--accent); color: #fff; background: var(--accent); }
.primary:hover:not(:disabled) { border-color: var(--accent-hover); background: var(--accent-hover); }

form { margin-top: 1.6rem; border-top: 1px solid var(--line); padding-top: 1.35rem; }
label { display: block; margin-bottom: .4rem; color: var(--muted); font-size: .875rem; font-weight: 650; }
.controls { display: grid; gap: .5rem; }
form .controls { grid-template-columns: minmax(0, 1fr) auto; }
input { width: 100%; min-width: 0; font-family: ui-monospace, monospace; }
input::placeholder { color: var(--muted); }

.invite {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .85rem;
    border: 1px solid var(--line);
    background: var(--tint);
}

.invite small, .invite strong { display: block; }
#invite-link { flex-basis: 100%; font-size: .8rem; }
.invite small { margin-bottom: .15rem; color: var(--muted); font-size: .8rem; }
.invite strong { font: 700 clamp(.85rem, 4vw, 1.14rem)/1.5 ui-monospace, monospace; color: var(--accent); }
.invite button { min-height: 2.75rem; background: var(--surface); }
#count { margin: .65rem 0 0; color: var(--accent); font-weight: 700; }
#audio-status { margin: .65rem 0 0; color: var(--muted); font-size: .875rem; }
#audio-status:empty { display: none; }
.audio-output { margin-top: .75rem; border: 1px solid var(--line); }
.audio-output summary {
    min-height: 3rem;
    padding: .72rem .85rem;
    color: var(--accent);
    font-weight: 700;
    cursor: pointer;
}
.output-options { display: grid; gap: .6rem; padding: 0 .85rem .85rem; }
.output-options select { appearance: auto; width: 100%; }
#output-status { margin: 0; color: var(--muted); font-size: .875rem; }
#output-status:empty { display: none; }
.call-actions { padding-top: 1rem; }
#mute[aria-pressed="true"] { background: #e1eafa; border-color: var(--accent); color: var(--accent-hover); }
.danger { background: #fdf0ed; color: #922e23; border-color: #b97166; }
.danger:hover:not(:disabled) { background: #fae1db; border-color: #922e23; }
.notice, #status { color: #70501f; background: #fff5e0; border-left: 3px solid #b68430; padding: .55rem .65rem; margin: 0 0 .8rem; font-size: .875rem; }
#status { margin: .8rem 0 0; }
footer { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .75rem; }

@media (min-width: 48rem) {
    .app { justify-content: center; padding: 3rem 2rem; }
    .app-header { padding-bottom: 1.5rem; }
    .workspace { flex: initial; grid-template-columns: 4rem minmax(0, 1fr); grid-template-rows: none; min-height: 28rem; }
    .signal-panel { padding: 1.4rem 0; border-right: 1px solid var(--line); border-bottom: 0; align-items: flex-start; justify-content: center; }
    .signal { flex-direction: column; width: 18px; height: 20rem; gap: 5px; }
    .signal i { width: 4px; height: 3px !important; }
    .signal i:nth-child(3), .signal i:nth-child(7) { width: 14px; }
    .signal i:nth-child(2), .signal i:nth-child(8) { width: 8px; }
    .signal i:nth-child(5) { width: 18px; }
    .signal::after { width: 1px; height: auto; min-height: 3rem; margin: 1rem 0 0; }
    .card { padding: 3rem; }
    #lobby { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 3rem; }
    #lobby .screen-heading { margin: 0; align-self: center; }
    #lobby .screen-actions { margin: 0; border-left: 1px solid var(--line); padding-left: 2rem; }
    #call .screen-heading { max-width: 34rem; }
    .invite { gap: 1rem; }
    .call-actions { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
}

@media (max-width: 47.99rem) {
    .app-header { padding-bottom: 1.1rem; }
    .brand { font-size: 1.85rem; }
    .header-note { max-width: 10rem; font-size: .75rem; }
    .card { padding: 1.4rem 1.15rem; }
    .screen-heading { padding-top: .5rem; }
    .screen-actions { padding-top: 2rem; }
    .call-actions { gap: .65rem; }
    .invite { padding: .9rem; }
    .invite button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    button { transition: none; }
}


