:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #16181d;
  --muted: #5d6470;
  --line: #dde1e7;
  --accent: #1f6feb;
  --rec: #d92d20;
  --rec-soft: #fde8e6;
  --ok: #138a4b;
  --ok-soft: #e3f5ea;
  --warn: #b54708;
  --warn-soft: #fef0c7;
  --radius: 18px;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { display: flex; flex-direction: column; font-size: 18px; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 14px; }
button:disabled { opacity: .4; cursor: default; }
[hidden] { display: none !important; }

header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line);
}
header h1 { font-size: 22px; margin: 0; font-weight: 700; }
.badge { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.spacer { flex: 1; }
#net { font-size: 15px; color: var(--muted); }
#net.bad { color: var(--rec); font-weight: 600; }

main {
  flex: 1; display: grid; grid-template-columns: minmax(340px, 1fr) minmax(420px, 1.25fr); grid-template-rows: 1fr auto;
  gap: 24px; padding: 24px 28px; min-height: 0;
}
.panel { background: var(--panel); border-radius: var(--radius); border: 1px solid var(--line); padding: 24px; min-height: 0; }
.info { display: flex; flex-direction: column; gap: 22px; overflow: auto; }
.room-btn { padding: 10px 16px; background: #eef0f3; font-size: 16px; font-weight: 600; }
.meeting-card { background: #f6f8fb; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.meeting-card .head { font-size: 20px; font-weight: 700; }
.meeting-card .sub { font-size: 15px; color: var(--muted); min-height: 1.2em; }
.meeting-card .row { margin-top: 6px; }
.meeting-card .btn-small { padding: 10px 14px; font-size: 15px; }
.people button.none { background: transparent; border: 2px dashed var(--line); color: var(--muted); }
.people button.on { background: var(--ok-soft); outline: 2px solid #9fd8b6; }
.events { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.events button { text-align: left; padding: 16px 18px; background: #eef0f3; font-size: 18px; }
.events button.on { background: var(--ok-soft); }
.events button.done { color: var(--muted); }
.label { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }

.organizer-btn {
  width: 100%; text-align: left; padding: 18px 20px; font-size: 22px; font-weight: 700;
  background: #eef3fd; color: var(--accent); border: 2px dashed #a9c3f3;
}
.organizer-btn.set { background: var(--ok-soft); color: var(--ink); border: 2px solid #9fd8b6; }
.organizer-btn small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px 8px 14px; border-radius: 999px; background: #eef0f3; font-size: 17px; }
.chip.fixed { background: var(--ok-soft); padding-right: 14px; }
.chip button { background: transparent; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; color: var(--muted); }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
input[type=text], input[type=password], input[type=search] {
  font: inherit; font-size: 19px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); width: 100%;
}
input:focus { outline: 3px solid #b7cdf6; border-color: var(--accent); }
.btn-small { padding: 0 20px; background: #e7ebf1; font-weight: 600; }
.hint { font-size: 14px; color: var(--muted); margin-top: 6px; }

.recorder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.state { font-size: 24px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 12px; }
.state .dot { width: 18px; height: 18px; border-radius: 50%; background: #c5cad3; }
.state.recording { color: var(--rec); }
.state.recording .dot { background: var(--rec); animation: blink 1.2s infinite; }
.state.paused { color: var(--warn); }
.state.paused .dot { background: var(--warn); }
@keyframes blink { 50% { opacity: .25; } }
.timer { font-size: clamp(64px, 10vw, 120px); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 2px; line-height: 1; }

.meter { width: min(520px, 100%); }
.meter .bar { height: 18px; border-radius: 9px; background: #e7ebf1; overflow: hidden; }
.meter .fill { height: 100%; width: 0; background: linear-gradient(90deg, #38b26b, #38b26b 70%, #e5a50a 85%, var(--rec)); transition: width .08s linear; }
.meter .caption { font-size: 14px; color: var(--muted); margin-top: 8px; min-height: 1.3em; }
.meter .caption.warn { color: var(--rec); font-weight: 600; }

.controls { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.big { min-width: 220px; padding: 28px 36px; font-size: 28px; font-weight: 700; border-radius: 22px; }
.btn-rec { background: var(--rec); color: #fff; min-width: 320px; }
.btn-pause { background: #e7ebf1; color: var(--ink); }
.btn-done { background: var(--ink); color: #fff; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: #e7ebf1; color: var(--ink); }
.need { font-size: 16px; color: var(--muted); }

.pending { grid-column: 1 / -1; padding: 16px 24px; display: flex; flex-direction: column; gap: 10px; }
.pending .head { font-weight: 700; color: var(--warn); }
.pending .item { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.pending .item span { flex: 1; }
.pending .item button { padding: 10px 16px; font-size: 15px; }

.overlay { position: fixed; inset: 0; background: rgba(15, 18, 24, .55); display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 10; }
.dialog { background: var(--panel); border-radius: 24px; padding: 32px; width: min(760px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 18px; }
.dialog h2 { margin: 0; font-size: 28px; }
.dialog p { margin: 0; font-size: 20px; color: var(--muted); line-height: 1.5; }
.dialog .controls { justify-content: flex-end; }
.dialog .big { min-width: 0; padding: 22px 30px; font-size: 22px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; overflow: auto; min-height: 120px; }
.people button { padding: 18px 10px; background: #eef0f3; font-size: 19px; font-weight: 600; }
.people button:hover, .people button:focus { background: #dfe7f7; }
.result { text-align: center; align-items: center; }
.result .icon { font-size: 64px; }
.error { color: var(--rec); font-weight: 600; }

@media (max-width: 900px) {
  main { grid-template-columns: 1fr; overflow: auto; }
  .big { min-width: 0; width: 100%; }
  .btn-rec { min-width: 0; }
}
