:root {
  --bg: #f3f7f5;
  --surface: #ffffff;
  --surface-strong: #eef6f3;
  --ink: #16302d;
  --muted: #667a76;
  --line: #dce7e3;
  --primary: #176d74;
  --primary-dark: #0e4c52;
  --accent: #3f86d9;
  --warning: #c8791c;
  --danger: #b84242;
  --shadow: 0 20px 50px rgba(26, 61, 57, 0.12);
  --shadow-soft: 0 10px 28px rgba(25, 58, 54, 0.08);
  --radius: 10px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f7fbfa 0%, var(--bg) 420px),
    var(--bg);
  color: var(--ink);
  font-family:
    "Noto Sans TC", "Source Han Sans TC", "Microsoft JhengHei", system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(210, 226, 221, 0.82);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 26px rgba(20, 55, 51, 0.06);
}

.header-left {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #16717a, #29a078);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(23, 109, 116, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.header-actions,
.hero-actions,
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions {
  justify-content: flex-end;
  min-width: 0;
  flex-shrink: 0;
}

.account-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px;
  border: 1px solid rgba(220, 231, 227, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.account-main {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0 6px 0 0;
}

.account-copy {
  display: grid;
  min-width: 0;
  text-align: left;
}

.account-copy strong,
.account-copy small {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy strong {
  font-size: 13px;
  font-weight: 900;
}

.account-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.account-auth-button {
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  background: #edf6f3;
  color: var(--primary-dark);
  cursor: pointer;
  font-weight: 900;
}

.account-pill[data-login-state="member"] .account-auth-button {
  background: #fff1f0;
  color: var(--danger);
}

.menu-shell {
  position: relative;
}

.menu-button {
  display: flex;
  flex-direction: column;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(220, 231, 227, 0.95);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.menu-button span {
  display: block;
  width: 22px;
  height: 2px;
  flex: 0 0 2px;
  border-radius: 2px;
  background: #24423f;
}

.menu-button:hover,
.menu-button[aria-expanded="true"] {
  background: var(--surface-strong);
}

.hamburger-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  display: grid;
  min-width: 238px;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(220, 231, 227, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.hamburger-menu a,
.hamburger-menu button {
  display: flex;
  min-height: 40px;
  align-items: center;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding: 0 12px;
  text-align: left;
  font-weight: 800;
}

.hamburger-menu a:hover,
.hamburger-menu button:hover {
  background: var(--surface-strong);
  color: var(--primary-dark);
}

.hamburger-menu a.active {
  background: #e7f4f0;
  color: var(--primary-dark);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.primary-button {
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(23, 109, 116, 0.18);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.danger-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button,
.ghost-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.82);
}

.danger-button {
  padding: 0 16px;
  background: #fff1f0;
  color: var(--danger);
}

.icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border: 1px solid var(--line);
  background: white;
  color: var(--primary);
}

.large {
  min-height: 48px;
  padding-inline: 22px;
}

.compact {
  min-height: 38px;
  padding-inline: 14px;
}

.hero-panel {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  padding: clamp(42px, 8vw, 96px) clamp(18px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(7, 33, 31, 0.78), rgba(7, 33, 31, 0.36) 54%, rgba(7, 33, 31, 0.08)),
    url("assets/campus-study-hero.png") center / cover no-repeat;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  background: linear-gradient(180deg, rgba(243, 247, 245, 0), var(--bg));
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  color: white;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.hero-copy .eyebrow {
  color: #9ee4d1;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 1.08;
  letter-spacing: 0;
  font-family:
    "Noto Serif TC", "Source Han Serif TC", "Noto Sans TC", serif;
  font-weight: 700;
}

h2 {
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 900;
}

h3 {
  font-size: 20px;
}

.hero-copy p:not(.eyebrow) {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 24px;
}

.hero-actions .primary-button {
  box-shadow: 0 16px 36px rgba(20, 76, 78, 0.32);
}

.hero-actions .ghost-button {
  border-color: rgba(255, 255, 255, 0.44);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  backdrop-filter: blur(10px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(270px, 320px) 1fr;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 54px) 64px;
}

.filter-panel,
.page-panel,
.dialog-card,
.room-card,
.record-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.filter-panel {
  position: sticky;
  top: 88px;
  z-index: 20;
  align-self: start;
  overflow: visible;
  padding: 20px;
  box-shadow: var(--shadow-soft);
}

label,
.filter-group {
  display: grid;
  gap: 7px;
}

label span,
.filter-group > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 109, 116, 0.12);
}

.search-box,
.filter-group,
.filter-grid,
.advanced-filter {
  margin-bottom: 18px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.chip.active {
  border-color: rgba(23, 109, 116, 0.28);
  background: var(--surface-strong);
  color: var(--primary-dark);
}

.filter-dropdown {
  position: relative;
}

.filter-dropdown summary {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: "";
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.2s ease;
}

.filter-dropdown[open] summary {
  border-color: rgba(23, 109, 116, 0.32);
  box-shadow: 0 0 0 3px rgba(23, 109, 116, 0.08);
}

.filter-dropdown[open] summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.filter-dropdown .check-grid {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 90;
  width: 100%;
  overflow: visible;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.filter-check {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.filter-check:hover,
.filter-check:has(input:checked) {
  border-color: var(--primary);
  background: #e7f4f0;
  color: var(--primary-dark);
}

.filter-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.filter-check span {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.has-tooltip {
  position: relative;
}

.has-tooltip::after {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 120;
  display: none;
  width: min(250px, 78vw);
  padding: 10px 12px;
  border: 1px solid rgba(207, 219, 215, 0.95);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.99);
  box-shadow: 0 14px 32px rgba(31, 67, 61, 0.14);
  color: var(--ink);
  content: attr(data-tooltip);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
  white-space: normal;
}

.filter-dropdown .has-tooltip::after {
  top: 50%;
  bottom: auto;
  left: calc(100% + 12px);
  width: 240px;
  transform: translateY(-50%);
  pointer-events: none;
}

.room-card .has-tooltip::after {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
}

.has-tooltip:hover::after,
.has-tooltip:focus-within::after {
  display: block;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.advanced-filter {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.advanced-filter summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.advanced-filter[open] summary {
  margin-bottom: 10px;
}

.advanced-filter label {
  margin-bottom: 10px;
}

.range-filter {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid rgba(220, 231, 227, 0.9);
  border-radius: 12px;
  background: #fff;
}

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

.range-filter-head span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.range-filter-head strong {
  color: var(--primary-dark);
  font-size: 13px;
}

.dual-range {
  position: relative;
  height: 28px;
}

.dual-range::before {
  position: absolute;
  top: 13px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  background: #dcebe6;
  content: "";
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.dual-range input[type="range"]:focus {
  box-shadow: none;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 3px 10px rgba(21, 92, 85, 0.22);
  cursor: grab;
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 3px 10px rgba(21, 92, 85, 0.22);
  cursor: grab;
  pointer-events: auto;
}

.range-help,
.field-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.room-area {
  min-width: 0;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 18px;
}

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

.room-card {
  --room-accent: var(--primary);
  --room-accent-dark: var(--primary-dark);
  --room-accent-soft: #e7f4f0;
  --room-accent-border: rgba(23, 109, 116, 0.3);
  position: relative;
  overflow: visible;
  display: grid;
  gap: 18px;
  padding: 22px 22px 20px 28px;
  border-width: 1.5px;
  box-shadow: 0 16px 38px rgba(31, 67, 61, 0.1);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.room-card:hover {
  z-index: 5;
  transform: translateY(-1px);
  box-shadow: 0 20px 48px rgba(31, 67, 61, 0.14);
}

.room-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--room-accent);
}

.room-card.intensity-light {
  --room-accent: #20a86d;
  --room-accent-dark: #0d6a45;
  --room-accent-soft: #edf9f2;
  --room-accent-border: #9ddfb9;
  background: linear-gradient(180deg, #f1fbf5 0%, #fbfffd 62%, #ffffff 100%);
  border-color: var(--room-accent-border);
}

.room-card.intensity-medium {
  --room-accent: #2d7dd2;
  --room-accent-dark: #1f5e9f;
  --room-accent-soft: #edf6ff;
  --room-accent-border: #9cc7ef;
  background: linear-gradient(180deg, #f2f8ff 0%, #fbfdff 62%, #ffffff 100%);
  border-color: var(--room-accent-border);
}

.room-card.intensity-intense {
  --room-accent: #e05f3f;
  --room-accent-dark: #ad3f23;
  --room-accent-soft: #fff0e8;
  --room-accent-border: #efb39d;
  background: linear-gradient(180deg, #fff5ef 0%, #fffbf8 62%, #ffffff 100%);
  border-color: var(--room-accent-border);
}

.room-card.intensity-light::before {
  background: var(--room-accent);
}

.room-card.intensity-medium::before {
  background: var(--room-accent);
}

.room-card.intensity-intense::before {
  background: var(--room-accent);
}

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.room-heading {
  min-width: 0;
}

.room-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: clamp(26px, 2.3vw, 28px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.22;
}

.status-pill,
.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.open {
  background: #dff7ed;
  color: #126d4b;
}

.status-pill.almost-full {
  background: #fff4df;
  color: var(--warning);
}

.status-pill.full,
.status-pill.ended {
  background: #263532;
  color: #fff;
}

.type-pill {
  border: 1px solid rgba(23, 109, 116, 0.12);
  background: #e9f5f1;
}

.room-core-summary {
  display: grid;
  grid-template-columns: 1.05fr 1.55fr 0.9fr;
  gap: 12px;
}

.meta-list {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
}

.core-item {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid rgba(102, 122, 118, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.74);
}

.core-item small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.core-item strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.core-icon {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  place-items: center;
  border-radius: 10px;
  background: var(--room-accent-soft);
  font-size: 15px;
}

.core-occupancy {
  border-color: color-mix(in srgb, var(--room-accent) 28%, white);
}

.host-row,
.member-row,
.card-actions,
.room-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  min-width: 34px;
  place-items: center;
  border-radius: 50%;
  background: #e7ecef;
  color: #4e5d62;
  font-weight: 800;
  object-fit: cover;
}

.avatar-male {
  background: #dcecff;
  color: #245a9f;
}

.avatar-female {
  background: #ffe1e8;
  color: #a33a56;
}

.avatar-unknown {
  background: #e8ecef;
  color: #566166;
}

.avatar-image {
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.tag {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.intensity-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.intensity-pill.intensity-light,
.intensity-option.light {
  background: #b9efcf;
  color: #0d6a45;
}

.intensity-pill.intensity-medium,
.intensity-option.medium {
  background: #c6e4ff;
  color: #1f62aa;
}

.intensity-pill.intensity-intense,
.intensity-option.intense {
  background: #ffd1bf;
  color: #bd4a25;
}

.occupancy-badge {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 4px;
  padding: 7px 13px;
  border: 1px solid #c9d6d2;
  border-radius: 999px;
  background: #ffffff;
  color: #203b37;
  font-weight: 900;
  white-space: nowrap;
}

.occupancy-badge .occ-current {
  color: inherit;
  font-size: 19px;
}

.occupancy-badge .occ-divider {
  color: inherit;
  font-size: 17px;
}

.occupancy-badge .occ-max {
  color: inherit;
  font-size: 19px;
}

.occupancy-badge.almost-full {
  border-color: #a87516;
  background: #fff8ea;
  color: #3d3524;
}

.occupancy-badge.full {
  border-color: #263532;
  background: #263532;
  color: #fff;
}

.occupancy-badge.full .occ-current,
.occupancy-badge.full .occ-divider,
.occupancy-badge.full .occ-max {
  color: #fff;
}

.occupancy-badge.compact {
  min-height: 40px;
  padding-inline: 14px;
}

.condition-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--room-accent) 16%, white);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.condition-summary span {
  display: grid;
  gap: 2px;
}

.condition-summary strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.condition-summary .condition-wide {
  grid-column: 1 / -1;
}

.room-people-summary {
  display: grid;
  gap: 10px;
  padding-block: 2px;
}

.people-summary-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
}

.people-label {
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 4px 11px 4px 4px;
  border: 1px solid rgba(102, 122, 118, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.member-chip .avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  font-size: 12px;
}

.more-chip {
  padding-inline: 12px;
  color: var(--muted);
}

.notes {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}

.room-note {
  display: -webkit-box;
  min-height: 43px;
  overflow: hidden;
  color: color-mix(in srgb, var(--ink) 86%, var(--muted));
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 2px;
}

.card-actions-left,
.card-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions-right {
  justify-content: flex-end;
}

.card-actions-right .primary-button {
  min-width: 148px;
}

.card-actions .primary-button:disabled {
  background: #e2e7e5;
  color: #697774;
  box-shadow: none;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 30px;
  border: 1px dashed #b8c9c4;
  border-radius: var(--radius);
  text-align: center;
}

.page-panel {
  margin: 28px clamp(18px, 4vw, 54px) 56px;
  padding: clamp(20px, 4vw, 34px);
}

.two-column {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 34px;
}

.soft-copy {
  color: var(--muted);
  line-height: 1.7;
}

.record-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab.active {
  background: var(--primary);
  color: white;
}

.record-list,
.settings-stack,
.panel-form {
  display: grid;
  gap: 14px;
}

.settings-profile-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(233, 247, 242, 0.92), rgba(255, 255, 255, 0.98)),
    white;
  box-shadow: var(--shadow-soft);
}

.settings-profile-card strong {
  color: var(--ink);
  font-size: 1.02rem;
}

.settings-profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.record-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 16px;
}

.record-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.switch-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.switch-row input {
  width: auto;
  min-height: auto;
}

.blacklist-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.dialog-card {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 0;
  padding: 0;
  box-shadow: var(--shadow);
}

.auth-dialog {
  width: min(430px, calc(100vw - 32px));
  border-radius: 24px;
  background:
    radial-gradient(circle at 14% 0%, rgba(48, 199, 101, 0.14), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(12, 31, 29, 0.22);
}

.wide-dialog {
  width: min(760px, calc(100vw - 32px));
}

.detail-dialog {
  width: min(960px, calc(100vw - 32px));
}

.dialog-card::backdrop {
  background: rgba(12, 31, 29, 0.44);
  backdrop-filter: blur(4px);
}

.dialog-close-form {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 12px 12px 0;
  background: linear-gradient(#fff 70%, rgba(255, 255, 255, 0));
}

.auth-dialog .dialog-close-form {
  position: absolute;
  right: 14px;
  top: 14px;
  padding: 0;
  background: transparent;
}

.auth-dialog .icon-button {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  border-color: rgba(203, 220, 215, 0.9);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--primary-dark);
  font-size: 20px;
}

.modal-form,
#roomDetail {
  display: grid;
  gap: 16px;
  padding: 0 24px 24px;
}

.auth-form {
  justify-items: center;
  gap: 20px;
  padding: 44px 34px 32px;
}

.auth-brand-lockup {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
}

.auth-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 10px 24px rgba(48, 199, 101, 0.25);
}

.auth-tabs {
  display: grid;
  width: min(260px, 100%);
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid #dceae5;
  border-radius: 999px;
  background: #eef7f3;
}

.auth-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
}

.auth-tabs .active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(26, 61, 57, 0.1);
}

.auth-heading {
  display: grid;
  max-width: 280px;
  gap: 8px;
  text-align: center;
}

.auth-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.35;
}

.auth-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.auth-form label {
  gap: 9px;
}

.auth-form label span {
  font-size: 14px;
}

.auth-form input {
  min-height: 50px;
  border: 1px solid #d6e4df;
  border-radius: 999px;
  background: #fff;
  color: #1d2527;
  padding-inline: 22px;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-input-shell {
  width: min(292px, 100%);
}

.auth-status {
  display: grid;
  width: min(292px, 100%);
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #cfe5de;
  border-radius: 18px;
  background: #f2faf7;
  color: #17453f;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.5;
  text-align: left;
}

.auth-status.success {
  border-color: #b8dfd1;
  background: #eefaf5;
  color: #0f4d42;
}

.auth-status.error {
  border-color: #f1b8ae;
  background: #fff4f1;
  color: #8d2f22;
}

.auth-status small {
  color: inherit;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.82;
}

.auth-inline-link {
  justify-self: start;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-submit {
  width: min(292px, 100%);
  min-height: 50px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.auth-submit:hover {
  background: var(--primary-dark);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

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

.avatar-preview-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.avatar-preview-field > span {
  color: var(--muted);
  font-weight: 700;
}

.avatar-preview-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdfc;
}

.avatar-preview-row small {
  color: var(--muted);
  line-height: 1.5;
}

.academic-track-card {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f7fbfa 0%, #ffffff 100%);
}

.academic-track-card > span {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.academic-track-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #d8e8e3;
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.checkbox-line input {
  width: auto;
  min-height: auto;
  accent-color: var(--primary);
}

.academic-track-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-row input {
  width: auto;
  min-height: auto;
}

.subsection-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.subsection-panel h3 {
  margin-bottom: 0;
  font-size: 17px;
}

.condition-card {
  background: linear-gradient(180deg, #f2faf7 0%, #fbfdfc 100%);
}

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

.condition-field {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.condition-field > span,
.condition-field > label > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.segmented-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.segmented-control label {
  display: block;
}

.segmented-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.segmented-control span {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
}

.segmented-control input:checked + span {
  background: var(--primary);
  color: #fff;
}

.range-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.range-pair label {
  gap: 6px;
}

.range-pair label span {
  color: var(--muted);
  font-size: 12px;
}

.intensity-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.intensity-option {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  line-height: 1.45;
}

.intensity-option input {
  width: auto;
  min-height: auto;
}

.intensity-option span {
  color: inherit;
  font-size: 12px;
  font-weight: 600;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 280px;
  gap: 22px;
}

.detail-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.detail-section h3 {
  margin-bottom: 0;
}

.danger-zone {
  border-color: #f0c7c2;
  background: #fff8f7;
}

.application-list,
.message-list {
  display: grid;
  gap: 10px;
}

.application-card,
.message-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.application-card footer {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.qr-box {
  display: grid;
  gap: 10px;
  place-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: white;
}

.qr-box img {
  width: 168px;
  height: 168px;
  border-radius: 4px;
}

.invite-code {
  padding: 8px 10px;
  border-radius: 6px;
  background: #eef6f3;
  color: var(--primary-dark);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 24px;
  z-index: 1200;
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
  padding: 14px 18px;
  border: 1px solid rgba(31, 73, 67, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  color: #153632;
  font-weight: 850;
  line-height: 1.55;
  text-align: center;
  box-shadow: 0 18px 42px rgba(16, 35, 32, 0.18);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
}

.notice-content {
  display: grid;
  gap: 16px;
  padding: 0 24px 24px;
}

.notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1060px) {
  .app-header {
    align-items: center;
    flex-wrap: nowrap;
  }

  .header-left {
    flex: 1;
  }

  .hamburger-menu {
    position: fixed;
    top: 74px;
    right: clamp(14px, 4vw, 30px);
    width: min(320px, calc(100vw - 28px));
  }

  .workspace,
  .two-column,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .filter-panel {
    position: static;
  }

  .filter-dropdown .has-tooltip::after {
    top: calc(100% + 8px);
    right: auto;
    bottom: auto;
    left: 0;
    width: min(260px, calc(100vw - 64px));
    transform: none;
  }

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

  .room-core-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intensity-options {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .app-header {
    gap: 10px;
    padding-inline: 14px;
  }

  .brand {
    min-width: auto;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .header-actions {
    width: auto;
    display: flex;
    gap: 8px;
  }

  .account-pill {
    padding: 3px;
  }

  .account-copy {
    display: none;
  }

  .account-auth-button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .menu-button {
    width: 40px;
    height: 40px;
  }

  .hero-panel {
    min-height: 500px;
    padding-block: 58px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 52px);
    line-height: 1.13;
  }

  .hero-actions,
  .card-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions > *,
  .card-actions > *,
  .card-actions-left,
  .card-actions-right,
  .section-heading .primary-button {
    width: 100%;
  }

  .card-actions-right {
    justify-content: space-between;
  }

  .room-card {
    padding: 18px 16px 16px 22px;
  }

  .room-card-header {
    gap: 12px;
  }

  .room-title {
    font-size: 24px;
  }

  .room-core-summary {
    grid-template-columns: 1fr;
  }

  .people-summary-row {
    grid-template-columns: 42px 1fr;
  }

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

  .academic-track-fields {
    grid-template-columns: 1fr;
  }

  .record-card {
    grid-template-columns: 1fr;
  }

  .record-actions,
  .notice-actions,
  .inline-grid,
  .range-pair,
  .condition-summary {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .record-actions > *,
  .notice-actions > *,
  .notice-actions form,
  .notice-actions button {
    width: 100%;
  }
}
