:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
[hidden] {
  display: none !important;
}
html {
  height: 100%;
}
body {
  background: #0a0a0a;
  color: #e8e8e8;
  font-family: var(--font-sans);
  min-height: 100%;
}
/* Signed-in shell: one viewport tall, no document scroll */
body:not(.page-gate) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
body.page-gate {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
.wrap {
  background: #0a0a0a;
  padding: 1.5rem;
}
body.page-gate .wrap {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100dvh;
  padding: 0;
  overflow: hidden;
}
body.page-gate .auth-bar {
  display: none;
}
body:not(.page-gate) .wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
body:not(.page-gate) .wrap.add-page {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body:not(.page-gate) #app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.auth-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.auth-bar .user-email {
  font-size: 12px;
  color: #666;
}
.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.nav-link {
  text-decoration: none;
}
.nav-btn {
  padding: 7px 16px;
  border-radius: 8px;
  border: 0.5px solid #333;
  background: #1a1a1a;
  color: #999;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.nav-btn.active {
  background: #2a2a2a;
  color: #f0f0f0;
  border-color: #555;
}
.section {
  display: none;
}
.section.active {
  display: block;
}
.card {
  background: #1a1a1a;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.candidate-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 0.5px solid #2a2a2a;
}
.candidate-controls {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.cc-btn {
  background: transparent;
  color: #777;
  border: 0.5px solid #2a2a2a;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}
.cc-btn:hover:not(:disabled) {
  background: #1a1a1a;
  color: #ccc;
  border-color: #444;
}
.cc-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.cc-btn-danger {
  color: #b07474;
}
.cc-btn-danger:hover:not(:disabled) {
  color: #f09595;
  border-color: #a32d2d;
  background: #2e1a1a;
}
.saving-indicator {
  font-size: 11px;
  color: #666;
  margin-right: 4px;
  min-width: 90px;
  text-align: right;
  font-family: var(--font-mono);
}

/* ---- Sidebar layout ---- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}
.sidebar {
  display: flex;
  flex-direction: column;
  background: #141414;
  border: 0.5px solid #2a2a2a;
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  min-width: 0;
}
.sidebar-header {
  padding: 12px;
  border-bottom: 0.5px solid #222;
}
.sidebar-search {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 0.5px solid #2a2a2a;
  background: #0f0f0f;
  color: #ddd;
  font-size: 13px;
  font-family: inherit;
}
.sidebar-search:focus {
  outline: none;
  border-color: #444;
}
.sidebar-search::placeholder {
  color: #555;
}
.filter-chips {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 0.5px solid #222;
  overflow-x: auto;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.filter-chips::-webkit-scrollbar {
  height: 0;
}
.chip {
  padding: 4px 11px;
  border-radius: 14px;
  border: 0.5px solid #2a2a2a;
  background: #1a1a1a;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  flex: 0 0 auto;
  transition: all 0.12s;
}
.chip:hover {
  color: #ccc;
  border-color: #444;
}
.chip.active {
  background: #2a2a2a;
  color: #f0f0f0;
  border-color: #555;
}
.sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 8px;
  min-height: 0;
}
.sidebar-group-header {
  padding: 12px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  font-weight: 500;
  position: sticky;
  top: 0;
  background: #141414;
  z-index: 1;
}
.sidebar-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  border-left: 2px solid transparent;
}
.sidebar-item:hover {
  background: #1a1a1a;
}
.sidebar-item.active {
  background: #1c1f2e;
  border-left-color: #6f7bd6;
}
.si-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.si-body {
  flex: 1;
  min-width: 0;
}
.si-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.si-name {
  font-size: 13px;
  color: #e8e8e8;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.si-time {
  font-size: 11px;
  color: #777;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.si-role {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-empty {
  padding: 28px 14px;
  text-align: center;
  color: #555;
  font-size: 12px;
  line-height: 1.55;
}
.sidebar-footer {
  padding: 10px 12px;
  border-top: 0.5px solid #222;
}
.btn-block {
  width: 100%;
}
.main-pane {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
}
.empty-pane {
  text-align: center;
  color: #666;
  font-size: 14px;
  padding: 4rem 1rem;
}

/* Inline schedule row inside a candidate card */
.schedule-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -0.25rem 0 1rem;
  font-size: 12px;
  color: #777;
  flex-wrap: wrap;
}
.schedule-row label {
  color: #555;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.schedule-row input[type='datetime-local'] {
  background: #111;
  color: #ccc;
  border: 0.5px solid #2a2a2a;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  color-scheme: dark;
}
.schedule-row .schedule-status {
  color: #888;
  font-size: 11px;
  margin-left: auto;
}

.meeting-link-row .meeting-link-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 0.5px solid #2a2a2a;
  background: #111;
  color: #ccc;
  font-size: 13px;
  font-family: inherit;
}
.meeting-link-input::placeholder {
  color: #555;
}
.meeting-link-input:focus {
  outline: none;
  border-color: #444;
}

@media (max-width: 760px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 40vh) minmax(0, 1fr);
  }
  .sidebar {
    max-height: 40vh;
    min-height: 0;
  }
}
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.cname {
  font-size: 15px;
  font-weight: 500;
  color: #f0f0f0;
}
.crole {
  font-size: 11px;
  color: #666;
  margin-top: 3px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
  vertical-align: middle;
}
.section-lbl {
  font-size: 11px;
  font-weight: 500;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 1.25rem 0 0.6rem;
}
.q-block {
  padding: 10px 0;
  border-bottom: 0.5px solid #222;
}
.q-block:last-child {
  border-bottom: none;
}
.q-text {
  font-size: 14px;
  color: #ccc;
  line-height: 1.65;
}
.look-for {
  font-size: 12px;
  color: #555;
  margin-top: 5px;
  font-style: italic;
}
.code-block {
  background: #111;
  border: 0.5px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem;
  margin: 10px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a8d8a8;
  line-height: 1.7;
  white-space: pre-wrap;
}
.case-scenario {
  background: #141414;
  border: 0.5px solid #2a2a2a;
  border-left: 2px solid #444;
  border-radius: 0;
  padding: 1rem;
  margin: 10px 0;
  font-size: 13px;
  color: #bbb;
  line-height: 1.65;
}
.prompt-label {
  font-size: 11px;
  color: #555;
  margin-bottom: 6px;
}
.answer-area {
  width: 100%;
  background: #111;
  border: 0.5px solid #2a2a2a;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  color: #ccc;
  font-family: var(--font-mono);
  resize: vertical;
  min-height: 80px;
  margin-top: 8px;
}
.answer-area:focus {
  outline: none;
  border-color: #444;
}
.score-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.score-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 0.5px solid #2a2a2a;
  background: #111;
  color: #777;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.score-btn:hover {
  border-color: #555;
  color: #ccc;
}
.score-btn.selected-green {
  background: #1a2e1a;
  border-color: #3b6d11;
  color: #97c459;
}
.score-btn.selected-amber {
  background: #2a1f0a;
  border-color: #854f0b;
  color: #ef9f27;
}
.score-btn.selected-red {
  background: #2e1a1a;
  border-color: #a32d2d;
  color: #f09595;
}
.flag-box {
  background: #1f1800;
  border: 0.5px solid #633806;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 1rem;
  font-size: 12px;
  color: #ef9f27;
  line-height: 1.6;
}
.divider {
  height: 0.5px;
  background: #222;
  margin: 1rem 0;
}
.hint-toggle {
  font-size: 11px;
  color: #555;
  cursor: pointer;
  margin-top: 6px;
  display: inline-block;
}
.hint-toggle:hover {
  color: #888;
}
.hint-content {
  display: none;
  background: #111;
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 6px;
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}
.hint-content.open {
  display: block;
}
.q-num {
  color: #444;
  font-size: 12px;
  margin-right: 6px;
}
.timer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 1rem;
}
.timer-display {
  font-size: 20px;
  font-weight: 500;
  color: #f0f0f0;
  font-family: var(--font-mono);
}
.timer-label {
  font-size: 12px;
  color: #555;
}
.t-btn {
  padding: 5px 12px;
  border-radius: 6px;
  border: 0.5px solid #333;
  background: #1a1a1a;
  color: #888;
  font-size: 12px;
  cursor: pointer;
}
.t-btn:hover {
  border-color: #555;
  color: #ccc;
}
.btn-primary {
  padding: 8px 18px;
  border-radius: 8px;
  border: 0.5px solid #444;
  background: #2a2a2a;
  color: #e8e8e8;
  font-size: 13px;
  cursor: pointer;
}
.btn-primary:hover {
  background: #333;
}
.btn-google {
  padding: 8px 16px;
  border-radius: 8px;
  border: 0.5px solid #333;
  background: #fff;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.add-page {
  max-width: 900px;
  margin: 0 auto;
}
.add-page h1 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.add-page p.muted {
  color: #666;
  font-size: 13px;
  margin-bottom: 1rem;
}
.json-input {
  width: 100%;
  min-height: 280px;
  background: #111;
  border: 0.5px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ccc;
  line-height: 1.5;
}
.json-input:focus {
  outline: none;
  border-color: #444;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.err {
  color: #f09595;
  font-size: 13px;
  margin-top: 8px;
}
.ok {
  color: #97c459;
  font-size: 13px;
  margin-top: 8px;
}

/* Sign-in (index gate) */
.sign-in-screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem) 1rem;
}
body.page-gate .sign-in-screen {
  flex: 1;
  min-height: 0;
  width: 100%;
}
.sign-in-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  max-width: 560px;
  height: min(70vh, 520px);
  margin: auto;
  background: radial-gradient(ellipse 80% 60% at 50% 35%, rgba(255, 255, 255, 0.06) 0%, transparent 55%);
  pointer-events: none;
}
.sign-in-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: clamp(1.35rem, 3.5vw, 2.75rem) clamp(1rem, 3vw, 2.25rem);
  background: linear-gradient(165deg, #181818 0%, #111 45%, #0d0d0d 100%);
  border: 1px solid #2e2e2e;
  border-radius: 18px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 28px 56px rgba(0, 0, 0, 0.55);
}
.sign-in-logo {
  width: 72px;
  height: auto;
  margin: 0 auto 1.35rem;
  display: block;
  filter: drop-shadow(0 6px 20px rgba(255, 255, 255, 0.07));
}
.sign-in-eyebrow {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #5c5c5c;
  margin-bottom: 0.35rem;
}
.sign-in-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #f4f4f4;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 0.85rem;
}
.sign-in-lede {
  font-size: 14px;
  line-height: 1.6;
  color: #8f8f8f;
  margin-bottom: clamp(1rem, 3vh, 1.85rem);
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
}
.btn-google--signin {
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.btn-google--signin:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
.sign-in-footnote {
  margin-top: 1.35rem;
  font-size: 12px;
  color: #555;
  line-height: 1.5;
}
