:root {
  --surface-dark: #121721;
  --line: rgba(18, 23, 33, 0.09);
  --text: #171c26;
  --muted: #677182;
  --brand: #1d3557;
  --brand-soft: #355c8b;
  --danger: #cc6b5a;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.88);
  --shadow-lg: 0 26px 54px rgba(23, 28, 38, 0.12);
  --shadow-md: 0 14px 28px rgba(23, 28, 38, 0.08);
}

body[data-theme="dark"] {
  --surface-dark: #0c1320;
  --line: rgba(212, 224, 255, 0.1);
  --text: #eef3fb;
  --muted: #aab5c8;
  --brand: #8ab4ff;
  --brand-soft: #5f8fe0;
  --danger: #ff8f7a;
  --surface: rgba(16, 24, 38, 0.84);
  --surface-strong: rgba(18, 28, 44, 0.94);
  --shadow-lg: 0 28px 60px rgba(3, 8, 18, 0.42);
  --shadow-md: 0 16px 34px rgba(3, 8, 18, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Malgun Gothic", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(211, 135, 87, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(53, 92, 139, 0.12), transparent 24%),
    linear-gradient(180deg, #f7f4ee 0%, #f1ede4 100%);
}

body[data-theme="dark"] {
  background:
    radial-gradient(circle at top left, rgba(74, 108, 173, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(19, 169, 179, 0.12), transparent 24%),
    linear-gradient(180deg, #09111d 0%, #0d1624 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.page-glow {
  position: fixed;
  width: 28rem;
  height: 28rem;
  pointer-events: none;
  filter: blur(18px);
  opacity: 0.4;
  z-index: 0;
}

.page-glow-left {
  top: -8rem;
  left: -10rem;
  background: radial-gradient(circle, rgba(211, 135, 87, 0.38), transparent 62%);
}

.page-glow-right {
  top: 8rem;
  right: -8rem;
  background: radial-gradient(circle, rgba(53, 92, 139, 0.22), transparent 60%);
}

.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
}

.sidebar {
  display: none;
  align-content: start;
  gap: 18px;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(14, 18, 28, 0.98), rgba(18, 23, 33, 0.95)),
    var(--surface-dark);
  color: #f4efe8;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block h1,
.topbar h2,
.hero h3,
.panel h3,
.section-head h3 {
  margin: 0;
  font-family: "Malgun Gothic", sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-overline,
.section-overline,
.panel-kicker,
.nav-kicker,
.sidebar-title {
  margin: 0 0 6px;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.72;
}

.brand-overline,
.section-overline,
.nav-kicker,
.topbar-copy,
.panel-kicker:not(.settings-inline-title) {
  display: none;
}

.brand-block h1 {
  font-size: 2rem;
}

.brand-description {
  margin: 10px 0 0;
  line-height: 1.55;
  color: rgba(244, 239, 232, 0.78);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  color: #f4efe8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.nav-link strong {
  font-size: 0.98rem;
  font-weight: 700;
}

.nav-link:hover,
.nav-link.active {
  transform: translateX(3px);
  background: linear-gradient(135deg, rgba(243, 223, 207, 0.14), rgba(53, 92, 139, 0.14));
  border-color: rgba(255, 255, 255, 0.14);
}

.sidebar-panel {
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
}

.sidebar-list {
  margin: 0;
  padding-left: 18px;
  color: rgba(244, 239, 232, 0.82);
  line-height: 1.65;
}

.main {
  padding: 20px 24px;
  min-height: 100vh;
  overflow: auto;
}

.topbar,
.section-head,
.panel-head,
.button-row,
.topbar-meta,
.hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 14px;
  align-items: start;
}

.topbar h2 {
  font-size: clamp(1.65rem, 2.3vw, 2.2rem);
}

.topbar-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-title {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.96rem;
}

.topbar-clock-wrap {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 2px;
}

.topbar-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-meta .meta-card {
  order: 1;
}

.home-trigger,
.settings-trigger,
.theme-trigger {
  display: inline-grid;
  place-items: center;
  width: 60px;
  min-width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.settings-trigger,
.theme-trigger {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.theme-trigger {
  order: 2;
}

.settings-trigger {
  order: 3;
  border-radius: 16px;
  border: 1px solid rgba(188, 199, 215, 0.65);
  background: linear-gradient(180deg, rgba(33, 44, 63, 0.96), rgba(24, 33, 49, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(9, 15, 24, 0.18);
}

.home-trigger:hover,
.home-trigger:focus-visible,
.theme-trigger:hover,
.theme-trigger:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(29, 53, 87, 0.16);
  border-color: rgba(29, 53, 87, 0.16);
  outline: none;
}

.settings-trigger:hover,
.settings-trigger:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(29, 53, 87, 0.16);
  border-color: rgba(29, 53, 87, 0.16);
  outline: none;
}

.theme-trigger.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
  border-color: transparent;
}

.theme-trigger-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: var(--brand);
}

.theme-trigger.is-active .theme-trigger-icon {
  color: white;
}

.settings-trigger-icon,
.home-trigger-icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--brand);
}

.home-trigger {
  flex-shrink: 0;
}

.settings-trigger:hover,
.settings-trigger:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(29, 53, 87, 0.16);
  border-color: rgba(29, 53, 87, 0.16);
  outline: none;
}

.settings-trigger.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
  border-color: transparent;
}

.settings-trigger-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #eef4ff;
}

.settings-trigger-icon svg {
  width: 24px;
  height: 24px;
}

.settings-trigger.is-active .settings-trigger-icon {
  color: white;
}

.meta-card,
.panel,
.stat-card,
.hero,
.action-card {
  backdrop-filter: blur(16px);
}

body[data-theme="dark"] .meta-card,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .action-card,
body[data-theme="dark"] .emphasis-panel,
body[data-theme="dark"] .settings-trigger,
body[data-theme="dark"] .theme-trigger,
body[data-theme="dark"] .home-trigger {
  background: rgba(15, 23, 36, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .settings-trigger {
  background: linear-gradient(180deg, rgba(30, 40, 58, 0.98), rgba(18, 26, 40, 0.98));
  border-color: rgba(180, 193, 214, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 26px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .flip-card,
body[data-theme="dark"] .picker-ball,
body[data-theme="dark"] .seat-cell,
body[data-theme="dark"] .attendance-tile,
body[data-theme="dark"] .alarm-item,
body[data-theme="dark"] .time-display-card,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] textarea,
body[data-theme="dark"] table,
body[data-theme="dark"] .preset-button,
body[data-theme="dark"] .file-button,
body[data-theme="dark"] .secondary-button {
  background: rgba(15, 23, 36, 0.92);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .stat-card,
body[data-theme="dark"] .meta-card {
  background: rgba(19, 29, 45, 0.96);
}

body[data-theme="dark"] .panel {
  background: rgba(18, 28, 44, 0.9);
}

body[data-theme="dark"] .emphasis-panel {
  background: rgba(28, 34, 47, 0.95);
}

body[data-theme="dark"] .primary-button {
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
}

body[data-theme="dark"] .view,
body[data-theme="dark"] .main {
  color: var(--text);
}

body[data-theme="dark"] .page-glow-left {
  background: radial-gradient(circle, rgba(94, 126, 189, 0.28), transparent 62%);
}

body[data-theme="dark"] .page-glow-right {
  background: radial-gradient(circle, rgba(59, 164, 173, 0.2), transparent 60%);
}

body[data-theme="dark"] .section-overline,
body[data-theme="dark"] .panel-kicker,
body[data-theme="dark"] .meta-card span,
body[data-theme="dark"] .stat-card span,
body[data-theme="dark"] .stat-card p,
body[data-theme="dark"] .topbar-copy,
body[data-theme="dark"] .voice-status,
body[data-theme="dark"] .helper-text,
body[data-theme="dark"] .note-meta,
body[data-theme="dark"] .alarm-meta span,
body[data-theme="dark"] .time-display-card p,
body[data-theme="dark"] .action-card span,
body[data-theme="dark"] .seat-empty,
body[data-theme="dark"] .seat-index {
  color: #c2cede;
}

body[data-theme="dark"] .panel h3,
body[data-theme="dark"] .section-head h3,
body[data-theme="dark"] .topbar h2,
body[data-theme="dark"] .stat-card strong,
body[data-theme="dark"] .meta-card strong,
body[data-theme="dark"] .time-display-card strong,
body[data-theme="dark"] .note-card p,
body[data-theme="dark"] .action-card strong {
  color: #f5f8fd;
}

body[data-theme="dark"] .mode-tab {
  background: rgba(30, 40, 56, 0.96);
  color: #d3def0;
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .mode-tab.is-active {
  color: white;
}

body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] textarea::placeholder {
  color: #93a3bb;
}

body[data-theme="dark"] .settings-trigger-icon,
body[data-theme="dark"] .theme-trigger-icon,
body[data-theme="dark"] .home-trigger-icon {
  color: #8ab4ff;
}

.meta-card {
  min-width: 140px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow-md);
}

.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.meta-card strong {
  display: block;
  margin-top: 4px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.85fr);
  gap: 16px;
  padding: 20px;
  margin-bottom: 14px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.58)),
    linear-gradient(125deg, rgba(243, 223, 207, 0.58), rgba(219, 231, 225, 0.54));
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
  align-items: start;
}

.hero h3 {
  margin-bottom: 10px;
  font-size: clamp(1.8rem, 2.2vw, 2.4rem);
  line-height: 1.12;
}

.hero-copy p:last-of-type {
  margin: 0;
  max-width: 44ch;
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.file-button,
.status-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
  box-shadow: 0 12px 24px rgba(29, 53, 87, 0.18);
}

.secondary-button,
.file-button,
.status-button {
  color: var(--brand);
  background: rgba(29, 53, 87, 0.08);
  border: 1px solid rgba(29, 53, 87, 0.08);
}

.primary-button:hover,
.secondary-button:hover,
.file-button:hover,
.status-button:hover,
.action-card:hover {
  transform: translateY(-1px);
  filter: saturate(1.02);
}

.stat-strip,
.dashboard-grid,
.content-grid,
.action-grid,
.attendance-board,
.group-results,
.note-list,
.duty-list,
.stack-actions {
  display: grid;
  gap: 14px;
}

.stat-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 14px;
}

.stat-card {
  appearance: none;
  text-align: left;
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-md);
}

.stat-link {
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.stat-link:hover,
.stat-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(29, 53, 87, 0.14);
  border-color: rgba(29, 53, 87, 0.2);
  outline: none;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
  font-weight: 700;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.88rem;
}

.noise-trigger-card {
  display: grid;
  align-content: center;
  justify-items: start;
}

.noise-trigger-icon {
  font-size: 1.25rem;
}

.dashboard-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.feature-panel {
  display: none;
}

.voice-panel {
  grid-column: span 8;
}

.voice-panel .panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.voice-panel .panel-head > div:first-child {
  min-width: 0;
}

.time-panel {
  grid-column: span 4;
}

.panel {
  padding: 18px;
  border-radius: 24px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
}

.emphasis-panel {
  background:
    linear-gradient(155deg, rgba(243, 223, 207, 0.72), rgba(255, 255, 255, 0.88)),
    var(--surface-strong);
}

.panel h3,
.section-head h3 {
  font-size: 1.24rem;
}

.section-head {
  margin-bottom: 12px;
}

.topbar-title,
.section-head > div,
.panel-head > div {
  display: grid;
  gap: 4px;
}

.action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-card {
  display: grid;
  gap: 6px;
  padding: 16px;
  text-align: left;
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(243, 223, 207, 0.4));
  border: 1px solid rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.action-card strong {
  font-size: 1rem;
}

.action-card span {
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.9rem;
}

.todo-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.55;
  font-size: 0.95rem;
}

.duty-item,
.group-card,
.attendance-tile,
.note-card {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.duty-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.picker-box {
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 16px;
  min-height: 178px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.86);
}

.picker-box strong {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 700;
}

.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(6px);
}

.noise-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.noise-meter-active {
  overflow: hidden;
}

.noise-overlay-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  align-items: stretch;
}

.noise-side-panel {
  padding: 24px 22px;
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow-y: auto;
  color: #f4f7fc;
  background: linear-gradient(180deg, rgba(16, 23, 34, 0.98), rgba(19, 28, 41, 0.96));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.noise-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.noise-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 247, 252, 0.76);
}

.noise-side-panel h2 {
  margin: 0;
  font-size: 1.5rem;
  color: white;
}

.noise-copy {
  margin: -6px 0 0;
  color: rgba(235, 241, 250, 0.78);
  line-height: 1.6;
}

.noise-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.noise-control-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.noise-control-card label {
  color: rgba(247, 250, 255, 0.9);
}

.noise-control-card input[type="range"] {
  appearance: none;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
}

.noise-control-card input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(120, 166, 255, 0.9));
}

.noise-control-card input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -8px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(19, 27, 43, 0.28);
}

.noise-control-card input[type="range"]::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(120, 166, 255, 0.9));
}

.noise-control-card input[type="range"]::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(19, 27, 43, 0.28);
}

.noise-helper {
  margin: 0;
  color: rgba(225, 233, 245, 0.72);
}

.noise-readout {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.noise-readout > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 250, 255, 0.88);
}

.noise-stage-wrap {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  min-width: 0;
  height: 100dvh;
  padding: 22px;
}

.noise-stage-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.noise-alert-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.noise-alert-chip.is-loud {
  background: rgba(231, 91, 76, 0.2);
  color: #ffd8d3;
}

.noise-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(180deg, #192432 0%, #101823 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.noise-stage-message {
  position: absolute;
  left: 50%;
  top: 18%;
  z-index: 2;
  transform: translateX(-50%);
  padding: 14px 24px;
  border-radius: 999px;
  background: rgba(12, 19, 30, 0.34);
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.42);
  box-shadow: 0 14px 40px rgba(3, 7, 14, 0.22);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease, background 180ms ease, color 180ms ease;
  pointer-events: none;
}

.noise-stage-message.is-visible {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.noise-stage-message.level-1 {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

.noise-stage-message.level-2 {
  background: rgba(255, 191, 71, 0.16);
  color: #ffe6a6;
}

.noise-stage-message.level-3 {
  background: rgba(255, 102, 102, 0.18);
  color: #ffd0d0;
}

.noise-stage.is-loud {
  box-shadow: inset 0 0 0 2px rgba(255, 119, 94, 0.24);
}

#noise-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.time-panel {
  display: grid;
  gap: 14px;
}

.time-mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mode-tab {
  min-height: 38px;
  border-radius: 12px;
  color: var(--brand);
  background: rgba(29, 53, 87, 0.08);
  border: 1px solid rgba(29, 53, 87, 0.08);
}

.mode-tab.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
}

.time-pane {
  display: none;
  gap: 12px;
}

.time-pane.is-active {
  display: grid;
}

.time-display-card {
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 132px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.time-display-card strong {
  font-size: clamp(2.9rem, 5vw, 4.8rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.time-input-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alarm-input-row {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.alarm-list {
  display: grid;
  gap: 8px;
}

.alarm-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.88);
}

.alarm-item.is-ringing {
  border-color: rgba(219, 68, 55, 0.36);
  background: linear-gradient(135deg, rgba(255, 236, 232, 0.96), rgba(255, 247, 243, 0.96));
  box-shadow: 0 16px 30px rgba(219, 68, 55, 0.16);
}

.alarm-meta {
  display: grid;
  gap: 2px;
}

.alarm-meta strong {
  font-size: 1rem;
}

.alarm-meta span {
  color: var(--muted);
  font-size: 0.84rem;
}

.alarm-status.is-ringing {
  color: #bb2d1f;
  font-weight: 700;
}

.alarm-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0.24s ease;
  z-index: 1200;
}

.alarm-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.alarm-overlay-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(255, 246, 240, 0.62), rgba(255, 96, 64, 0.2) 34%, rgba(19, 27, 48, 0.84) 82%);
}

.alarm-overlay.is-active .alarm-overlay-backdrop {
  animation: alarmBackdropFlash 1s ease-in-out infinite;
}

.alarm-modal {
  position: relative;
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(255, 253, 251, 0.98), rgba(255, 244, 239, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.42);
  text-align: center;
  z-index: 1;
}

.alarm-overlay.is-active .alarm-modal {
  animation: alarmModalPulse 1.1s ease-in-out infinite;
}

.alarm-badge {
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a59, #e65136);
  color: white;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.alarm-modal h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3.6vw, 2.4rem);
}

.alarm-modal-time {
  margin: 0;
  color: #bb2d1f;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1;
  font-weight: 800;
}

.alarm-modal-copy {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.alarm-modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

body.alarm-active {
  overflow: hidden;
}

body.alarm-active .app-shell {
  filter: blur(1.5px);
}

@keyframes alarmBackdropFlash {
  0%,
  100% {
    opacity: 0.92;
  }

  50% {
    opacity: 1;
  }
}

@keyframes alarmModalPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.02);
  }
}

.flip-clock {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.flip-clock-topbar {
  gap: 8px;
}

.flip-clock-topbar .flip-group {
  gap: 6px;
}

.flip-clock-topbar .flip-card {
  width: 44px;
  height: 58px;
  border-radius: 10px;
}

.flip-clock-topbar .flip-half {
  font-size: 2rem;
}

.flip-clock-topbar .flip-separator {
  font-size: 1.4rem;
  transform: translateY(-2px);
}

.flip-group {
  display: flex;
  gap: 8px;
}

.flip-separator {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  transform: translateY(-4px);
}

.flip-digit {
  perspective: 600px;
}

.flip-card {
  position: relative;
  width: 66px;
  height: 84px;
  border-radius: 14px;
  background: linear-gradient(180deg, #172132, #111827);
  box-shadow: 0 12px 22px rgba(10, 16, 28, 0.22);
  overflow: hidden;
}

.flip-card::after {
  content: "";
  position: absolute;
  top: calc(50% - 1px);
  left: 0;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.12);
  z-index: 4;
}

.flip-half {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f8fafc;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  backface-visibility: hidden;
  overflow: hidden;
}

.flip-top {
  clip-path: inset(0 0 50% 0);
  background: linear-gradient(180deg, #243349, #1a2436);
  transform-origin: center center;
}

.flip-bottom {
  clip-path: inset(50% 0 0 0);
  background: linear-gradient(180deg, #162031, #0e1522);
  transform-origin: center center;
}

.flip-anim-top,
.flip-anim-bottom {
  z-index: 5;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.flip-digit.is-flipping .flip-anim-top,
.flip-digit.is-flipping .flip-anim-bottom {
  visibility: visible;
}

.flip-digit.is-flipping .flip-anim-top {
  animation: flipTop 0.38s ease-in forwards;
}

.flip-digit.is-flipping .flip-anim-bottom {
  animation: flipBottom 0.38s ease-out 0.38s forwards;
}

.voice-controls {
  display: grid !important;
  grid-auto-flow: column !important;
  grid-auto-columns: max-content !important;
  gap: 8px !important;
  align-items: center !important;
  justify-content: end !important;
  white-space: nowrap !important;
  min-width: max-content !important;
}

.voice-controls .primary-button,
.voice-controls .secondary-button {
  width: auto !important;
  min-width: 0 !important;
  flex: 0 0 auto !important;
}

@media (max-width: 760px) {
  .voice-panel .panel-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.voice-select-wrap {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.voice-select-wrap-hidden label {
  display: none;
}

.voice-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.voice-dashboard-note {
  margin-bottom: 10px;
}

.speech-text {
  min-height: 88px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preset-editor-block {
  display: grid;
  gap: 12px;
  padding-top: 6px;
}

.compact-head {
  margin-bottom: 0;
}

.preset-editor-list {
  display: grid;
  gap: 10px;
}

.preset-editor-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: start;
}

.preset-editor-index {
  min-width: 32px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.preset-editor-input {
  min-height: 46px;
}

.preset-button {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 12px;
  text-align: left;
  color: var(--brand);
  background: rgba(29, 53, 87, 0.06);
  border: 1px solid rgba(29, 53, 87, 0.08);
}

.preset-button:hover {
  background: rgba(29, 53, 87, 0.1);
}

.content-grid {
  grid-template-columns: 1fr;
}

.content-grid.two-column {
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
}

#view-groups .content-grid.two-column {
  align-items: start;
  grid-template-columns: 1fr;
  gap: 16px;
}

#view-groups .panel {
  align-self: start;
}

#view-groups .content-grid.two-column > .emphasis-panel {
  order: -1;
}

#view-groups .picker-box {
  min-height: 320px;
  width: 100%;
  padding: 28px 24px;
}

#view-groups .picker-box strong {
  font-size: clamp(2.3rem, 4.5vw, 3.6rem);
}

#view-groups .picker-stage {
  width: min(100%, 560px);
}

#view-groups .picker-box > p {
  margin: 0;
}

#view-groups .content-grid.two-column > section:first-child {
  width: 100%;
}

#view-groups .group-results {
  margin-bottom: 8px;
}

#view-groups .section-divider {
  margin: 18px 0 16px;
}

.stack-form,
.inline-form {
  display: grid;
  gap: 12px;
}

.inline-form {
  grid-template-columns: 1fr auto;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(23, 28, 38, 0.1);
  border-radius: 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(29, 53, 87, 0.28);
  box-shadow: 0 0 0 4px rgba(29, 53, 87, 0.08);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.row-actions,
.attendance-tile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-button {
  color: var(--danger);
  background: rgba(204, 107, 90, 0.08);
  border: 1px solid rgba(204, 107, 90, 0.1);
}

.attendance-guide {
  margin: 10px 0 12px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.attendance-board {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.attendance-tile {
  display: grid;
  gap: 10px;
}

.attendance-tile-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.attendance-tile-header strong {
  display: block;
  font-size: 1rem;
}

.attendance-tile-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.attendance-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(29, 53, 87, 0.08);
  color: var(--brand);
}

.attendance-badge[data-status="결석"] {
  background: rgba(204, 107, 90, 0.12);
  color: var(--danger);
}

.attendance-badge[data-status="지각"] {
  background: rgba(211, 135, 87, 0.16);
  color: #9a582d;
}

.attendance-badge[data-status="조퇴"] {
  background: rgba(103, 113, 130, 0.16);
  color: #4b5563;
}

.status-button.is-active {
  color: white;
  background: linear-gradient(135deg, var(--brand), var(--brand-soft));
}

.picker-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  min-height: 112px;
  padding: 14px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(211, 135, 87, 0.2), transparent 45%),
    rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.picker-stage.is-animating {
  animation: pickerPulse 0.16s ease-in-out infinite alternate;
}

.picker-stage.is-picked {
  animation: pickerReveal 0.55s ease;
}

.picker-flash {
  position: absolute;
  inset: -40%;
  opacity: 0;
  background: conic-gradient(from 0deg, transparent, rgba(211, 135, 87, 0.35), transparent, rgba(53, 92, 139, 0.24), transparent);
}

.picker-stage.is-animating .picker-flash {
  opacity: 1;
  animation: pickerSpin 0.9s linear infinite;
}

.picker-stage strong {
  position: relative;
  z-index: 1;
  text-align: center;
}

.group-card p,
.note-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.note-edit-row {
  margin-top: 4px;
}

.section-divider {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.seat-layout-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  margin-bottom: 10px;
}

.seat-actions {
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.seat-help {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.seat-grid {
  display: grid;
  grid-template-columns: repeat(var(--seat-cols, 4), minmax(0, 1fr));
  gap: 8px;
}

.seat-cell {
  display: grid;
  gap: 4px;
  padding: 10px;
  text-align: left;
  min-height: 74px;
  border-radius: 14px;
  border: 1px solid rgba(29, 53, 87, 0.14);
  background: rgba(255, 255, 255, 0.72);
}

.seat-cell:hover {
  background: rgba(255, 255, 255, 0.92);
}

.seat-cell.is-selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 53, 87, 0.14);
}

.seat-index {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
}

.seat-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.seat-empty {
  color: var(--muted);
  font-size: 0.88rem;
}

.note-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}

.note-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.helper-text {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.94rem;
}

.class-name-only {
  font-size: 0;
}

.class-name-only input {
  font-size: 1rem;
}

.settings-inline-tools {
  display: grid;
  gap: 10px;
  margin: 2px 0 14px;
}

.settings-inline-title {
  margin: 6px 0 0;
}

.settings-inline-tools .stack-actions {
  gap: 10px;
}

.backup-panel-hidden {
  display: none;
}

label:has(#todo-input) {
  display: none;
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero,
  .stat-strip,
  .content-grid.two-column,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .feature-panel,
  .voice-panel,
  .time-panel {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .main,
  .sidebar {
    padding: 16px;
  }

  .topbar,
  .section-head,
  .panel-head,
  .button-row,
  .topbar-meta,
  .hero-actions,
  .inline-form,
  .duty-item,
  .attendance-tile-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .action-grid,
  .stat-strip,
  .attendance-tile-actions,
  .preset-grid,
  .time-mode-tabs,
  .time-input-row {
    grid-template-columns: 1fr;
  }

  .preset-editor-item {
    grid-template-columns: 1fr;
  }

  .alarm-modal-actions {
    flex-direction: column-reverse;
  }

  .seat-layout-form {
    grid-template-columns: 1fr;
  }

  .seat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .noise-overlay-shell {
    grid-template-columns: 1fr;
  }

  .noise-side-panel,
  .noise-stage-wrap {
    padding: 16px;
  }

  .noise-stage {
    min-height: 46vh;
  }

  .flip-clock {
    gap: 6px;
  }

  .flip-card {
    width: 52px;
    height: 68px;
  }

  .flip-half {
    font-size: 2.4rem;
  }
}

@media (min-width: 1500px) and (min-height: 900px) {
  .main {
    padding: 16px 20px;
  }

  .topbar {
    margin-bottom: 10px;
  }

  .topbar-copy {
    font-size: 0.9rem;
  }

  .hero {
    padding: 16px 18px;
    margin-bottom: 10px;
  }

  .stat-strip {
    gap: 10px;
    margin-bottom: 10px;
  }

  .stat-card {
    padding: 12px 14px;
  }

  .stat-card strong {
    font-size: 1.4rem;
  }

  .stat-card p {
    font-size: 0.82rem;
  }

  .dashboard-grid {
    gap: 10px;
  }

  .panel {
    padding: 14px;
  }

  .panel h3 {
    font-size: 1.08rem;
  }

  .action-card {
    padding: 12px;
  }

  .speech-text {
    min-height: 72px;
  }

  .timer-box {
    min-height: 150px;
  }

  .todo-list {
    font-size: 0.88rem;
  }
}

@keyframes pickerSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes pickerPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.02);
  }
}

@keyframes pickerReveal {
  0% {
    transform: scale(0.92);
    filter: brightness(0.96);
  }

  55% {
    transform: scale(1.04);
    filter: brightness(1.08);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes flipTop {
  from {
    transform: perspective(600px) rotateX(0deg);
    opacity: 1;
  }

  to {
    transform: perspective(600px) rotateX(-90deg);
    opacity: 1;
  }
}

@keyframes flipBottom {
  from {
    transform: perspective(600px) rotateX(90deg);
    opacity: 1;
  }

  to {
    transform: perspective(600px) rotateX(0deg);
    opacity: 1;
  }
}
