:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f6f8f7;
  --text: #1d2a2a;
  --muted: #64706f;
  --line: #dbe4e1;
  --primary: #126b62;
  --primary-strong: #0b514b;
  --accent: #b4442f;
  --warning: #b78017;
  --success: #287a43;
  --shadow: 0 18px 50px rgba(29, 42, 42, 0.08);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #fff;
  color: var(--text);
}

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

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

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: none;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 800;
}

.brand h1,
.topbar h2,
.notice h2,
.booking-card h3,
.dialog-card h3 {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
}

.brand p,
.notice p,
.meta,
.purpose,
.form-actions p,
.eyebrow {
  color: var(--muted);
}

.brand p {
  margin: 4px 0 0;
  font-size: 13px;
}

.role-switch,
.nav-list {
  display: grid;
  gap: 8px;
}

.role-switch {
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
}

.role-switch button,
.nav-list button {
  min-height: 40px;
  border-radius: 6px;
  color: var(--text);
  background: transparent;
}

.role-switch button.active,
.nav-list button.active {
  background: var(--primary);
  color: #fff;
}

.nav-list button {
  text-align: left;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.7);
}

.static-nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.7);
}

.static-nav a.active {
  background: var(--primary);
  color: #fff;
}

.notice {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
}

.notice h2 {
  font-size: 16px;
}

.notice p {
  line-height: 1.55;
  margin: 10px 0 0;
  font-size: 14px;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.availability-note {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid #cfe1dc;
  border-left: 4px solid var(--primary);
  background: #f6faf8;
  border-radius: 6px;
}

.availability-note strong {
  font-size: 16px;
}

.availability-note p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.main {
  padding: 30px;
  min-width: 0;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 14px;
}

.topbar > div:not(.brand-logos):first-of-type,
.topbar-title {
  flex: 1;
  min-width: 0;
}

.brand-logos {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 42px;
}

.brand-logos img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}

.brand-logos img:nth-child(3) {
  width: 74px;
  border-radius: 4px;
}

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

.feedback-shortcut {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.feedback-shortcut:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.eyebrow {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  margin-bottom: 6px;
}

.topbar h2 {
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0;
  line-height: 1.18;
}

.system-title-line,
.portal-title-line {
  display: block;
}

.topbar .eyebrow {
  display: none;
}

.today-pill {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  white-space: nowrap;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.page-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  background: #fff;
  font-weight: 700;
}

.page-nav a.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 26px rgba(29, 42, 42, 0.05);
  border-radius: 8px;
  padding: 20px;
}

.admin-section {
  margin-top: 18px;
}

.admin-group {
  margin-top: 22px;
}

.admin-group-title {
  padding: 6px 2px 2px;
  border-bottom: 1px solid var(--line);
}

.admin-group-title h2 {
  margin: 0;
  font-size: 18px;
  color: var(--primary-strong);
}

.admin-group .admin-section:first-of-type {
  margin-top: 12px;
}

.admin-section.panel {
  padding: 0;
  overflow: hidden;
}

.admin-details summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "title button"
    "desc button";
  gap: 6px;
  padding: 20px;
  cursor: pointer;
  list-style: none;
  border-bottom: 1px solid transparent;
}

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

.admin-details summary::after {
  content: "展开";
  grid-area: button;
  justify-self: end;
  align-self: center;
  min-width: 56px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.admin-details[open] summary {
  border-bottom-color: var(--line);
}

.admin-details[open] summary::after {
  content: "收起";
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.admin-details summary span {
  grid-area: title;
  font-size: 22px;
  font-weight: 900;
}

.admin-details summary small {
  grid-area: desc;
  max-width: 860px;
  color: var(--muted);
  line-height: 1.45;
}

.admin-detail-body {
  padding: 20px;
}

.admin-detail-body > .section-title:first-child,
.admin-detail-body form > .section-title:first-child {
  display: none;
}

.form-block-title {
  margin: 6px 0 16px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  background: var(--surface-soft);
  border-radius: 6px;
}

.form-block-title h4 {
  margin: 0;
  font-size: 17px;
}

.form-block-title p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-detail-body form + form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.compact-form {
  margin-bottom: 20px;
}

.student-records {
  margin-bottom: 20px;
}

.notice-inline {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  line-height: 1.6;
}

.notice-inline strong {
  color: var(--text);
}

.current-duty-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface-soft);
  color: var(--primary-strong);
  line-height: 1.5;
}

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

label {
  display: grid;
  gap: 7px;
  align-content: start;
  font-weight: 700;
  font-size: 14px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

input,
select {
  min-height: 43px;
  height: 43px;
}

input[type="checkbox"] {
  min-height: 18px;
  width: 18px;
  height: 18px;
  padding: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 107, 98, 0.12);
}

.wide {
  margin-top: 14px;
}

.form-grid > .wide {
  grid-column: 1 / -1;
  margin-top: 0;
}

.form-grid > .wide textarea {
  min-height: 88px;
}

.form-actions,
.booking-main,
.card-actions,
.photo-row,
.dialog-card header,
.dialog-card menu {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-actions {
  justify-content: space-between;
  margin-top: 16px;
}

.form-actions p {
  margin: 0;
  min-height: 1.5em;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, max-content));
  align-items: end;
  justify-content: start;
  gap: 12px;
  margin-bottom: 16px;
}

.toolbar label {
  width: min(320px, 100%);
  min-width: 220px;
}

.toolbar input,
.toolbar select,
.toolbar button {
  min-height: 42px;
}

.toolbar button {
  align-self: end;
  white-space: nowrap;
}

.primary,
.secondary,
.danger,
.warn,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 700;
}

.primary {
  background: var(--primary);
  color: #fff;
}

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

.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.danger {
  background: var(--accent);
  color: #fff;
}

.warn {
  background: #fff4d7;
  color: #7a520b;
  border: 1px solid #ead19a;
}

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

.room-card {
  min-height: 168px;
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.room-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.62));
}

.room-card > * {
  position: relative;
  z-index: 1;
}

.room-card h3 {
  margin: 0;
  font-size: 22px;
}

.room-card p {
  margin: 8px 0 0;
}

.room-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.room-tags span,
.status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.room-tags span {
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
}

.room-availability {
  border-top: 1px solid var(--line);
}

.availability-prompt,
.availability-loading,
.availability-error {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 18px 0;
  color: var(--muted);
  text-align: center;
}

.availability-error {
  flex-wrap: wrap;
  color: var(--accent);
}

.booking-time-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 10px;
}

.booking-time-heading strong {
  font-size: 17px;
}

.booking-time-heading span {
  color: var(--muted);
  font-size: 13px;
}

.booking-time-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.booking-time-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.booking-time-legend i {
  width: 14px;
  height: 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.booking-time-legend i.expired {
  background: #e8ecea;
}

.booking-time-legend i.booked {
  border-color: #d9978d;
  background: #fff0ed;
}

.booking-time-legend i.available {
  background: #fff;
}

.booking-time-legend i.selected {
  border-color: var(--primary);
  background: var(--primary);
}

.booking-time-track {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
}

.booking-time-segment {
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.booking-time-segment.available:hover {
  border-color: var(--primary);
}

.booking-time-segment.expired,
.booking-time-segment.not_open {
  border-color: #dfe4e2;
  background: #e8ecea;
  color: #8c9693;
}

.booking-time-segment.booked {
  border-color: #d9978d;
  background: #fff0ed;
  color: #a33f32;
}

.booking-time-segment.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.booking-time-segment:disabled {
  cursor: not-allowed;
}

.booking-time-summary {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--primary-strong);
  font-weight: 800;
}

.mobile-select-overlay[hidden] {
  display: none;
}

.mobile-select-overlay {
  position: fixed;
  z-index: 1200;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  background: rgba(20, 28, 27, 0.42);
}

.mobile-select-panel {
  width: min(100%, 520px);
  max-height: min(72vh, 620px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(29, 42, 42, 0.2);
}

.mobile-select-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-select-panel h2 {
  margin: 0;
  font-size: 18px;
}

.mobile-select-options {
  min-height: 0;
  display: grid;
  gap: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mobile-select-option {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.mobile-select-option[aria-selected="true"] {
  border-color: var(--primary);
  background: #edf8f5;
  color: var(--primary-strong);
  font-weight: 800;
}

.mobile-select-option:disabled {
  color: #9ca4a2;
  background: #f3f5f4;
  cursor: not-allowed;
}

body.mobile-select-open {
  overflow: hidden;
}

@media (max-width: 680px) {
  .mobile-select-trigger,
  select[data-mobile-select] {
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
  }
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title h3 {
  margin: 0;
  font-size: 20px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.booking-list {
  display: grid;
  gap: 12px;
}

.booking-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
}

.booking-main {
  justify-content: space-between;
  align-items: flex-start;
}

.booking-card h3 {
  font-size: 18px;
}

.meta,
.purpose {
  line-height: 1.55;
}

.meta {
  margin: 6px 0 0;
}

.purpose {
  margin: 12px 0;
}

.status.pending {
  background: #edf2f7;
  color: #415167;
}

.status.checked-in {
  background: #dff3e5;
  color: var(--success);
}

.status.done {
  background: #e6f3f1;
  color: var(--primary);
}

.status.registered {
  background: #edf2f7;
  color: #415167;
}

.status.on-duty {
  background: #dff3e5;
  color: var(--success);
}

.status.completed {
  background: #e6f3f1;
  color: var(--primary);
}

.status.absent {
  background: #fde7e2;
  color: var(--accent);
}

.status.cancelled,
.status.banned {
  background: #fde7e2;
  color: var(--accent);
}

.status.violation {
  background: #fff4d7;
  color: var(--warning);
}

.photo-row {
  align-items: flex-start;
  flex-wrap: wrap;
  margin: 10px 0;
}

.violation-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff4d7;
  color: #7a520b;
  line-height: 1.5;
}

.photo-thumb {
  width: 128px;
  height: 90px;
  border-radius: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--surface-soft);
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-grid article {
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.metric-grid strong {
  display: block;
  font-size: 34px;
  color: var(--primary);
}

.metric-grid span {
  color: var(--muted);
}

dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(14, 24, 24, 0.58);
}

.dialog-card {
  width: min(620px, calc(100vw - 28px));
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.dialog-card header {
  justify-content: space-between;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-size: 24px;
  background: var(--surface-soft);
}

#watermarkCanvas {
  display: none;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 12px;
  background: var(--surface-soft);
}

#cameraPreview {
  width: 100%;
  max-height: 360px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #111;
  object-fit: cover;
  margin-top: 12px;
}

#cameraPreview[hidden],
.camera-recovery[hidden] {
  display: none;
}

.camera-notice,
.camera-error {
  margin: 10px 0 0;
  line-height: 1.5;
}

.camera-notice {
  color: var(--muted);
}

.camera-error {
  color: var(--accent);
}

.camera-recovery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.sample-photo {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 12px;
  background: var(--surface-soft);
}

.reason-wrap {
  display: none;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.module-fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
}

.module-fieldset legend {
  padding: 0 8px;
  font-weight: 800;
}

.module-fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.module-fieldset input {
  width: auto;
}

.feedback-process {
  grid-template-columns: minmax(220px, 1fr) 160px;
  margin: 12px 0;
}

.export-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.dialog-card menu {
  justify-content: flex-end;
  padding: 0;
  margin: 16px 0 0;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
}

.portal {
  min-height: 100vh;
  width: min(1100px, 100%);
  margin: 0 auto;
  display: grid;
  align-content: start;
  gap: 24px;
  padding: 64px 28px 36px;
  position: relative;
}

.portal-feedback {
  position: absolute;
  top: 22px;
  right: 28px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
}

.portal-feedback:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.portal-logos {
  justify-content: center;
  margin-top: 4px;
  min-height: 56px;
}

.portal-logos img {
  width: 56px;
  height: 56px;
}

.portal-logos img:nth-child(3) {
  width: 96px;
}

.portal-hero {
  width: 100%;
  color: var(--text);
  text-align: center;
  padding: 0;
}

.portal-hero h1 {
  width: min(850px, 100%);
  margin: 8px auto 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.18;
  letter-spacing: 0;
}

.portal-hero p {
  width: min(720px, 100%);
  margin: 0 auto;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.portal-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 0;
}

.portal-card {
  min-height: 118px;
  align-items: flex-start;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 18px;
  box-shadow: 0 8px 24px rgba(29, 42, 42, 0.05);
}

.portal-card:hover {
  border-color: var(--primary);
}

.portal-card strong {
  font-size: 20px;
}

.portal-card span {
  color: var(--muted);
  line-height: 1.45;
  font-weight: 400;
}

.portal-card.admin-card {
  border-color: rgba(18, 107, 98, 0.28);
}

.portal-rules {
  width: min(360px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.portal-rules article {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
}

.portal-rules strong {
  display: block;
  font-size: 24px;
  color: var(--primary);
}

.portal-rules span {
  color: var(--muted);
}

.global-footer {
  margin: 8px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.contact-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: center;
  line-height: 1.7;
}

.contact-box strong {
  color: var(--text);
}

.global-footer p {
  margin: 8px 0 0;
}

.big-code {
  margin: 14px 0;
  padding: 18px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary-strong);
  font-size: clamp(34px, 10vw, 56px);
  font-weight: 900;
  text-align: center;
  letter-spacing: 0;
}

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

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

  .sidebar {
    position: static;
    height: auto;
  }

  .form-grid,
  .room-grid,
  .metric-grid,
  .module-fieldset {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .main {
    width: 100%;
  }

  .topbar,
  .form-actions,
  .booking-main,
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
  }

  .brand-logos {
    width: 100%;
    justify-content: center;
  }

  .brand-logos img {
    width: 34px;
    height: 34px;
  }

  .brand-logos img:nth-child(3) {
    width: 62px;
  }

  .topbar h2 {
    font-size: clamp(13px, 4.2vw, 20px);
    line-height: 1.45;
    text-align: center;
  }

  .system-title-line,
  .portal-title-line {
    white-space: nowrap;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
  }

  .panel {
    padding: 16px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
  }

  .today-pill {
    white-space: normal;
    text-align: center;
  }

  .form-grid,
  .room-grid,
  .metric-grid,
  .portal-rules,
  .module-fieldset,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .toolbar label,
  .toolbar button {
    width: 100%;
    min-width: 0;
  }

  .card-actions button,
  .form-actions button,
  .toolbar button {
    width: 100%;
  }

  .portal {
    gap: 18px;
    padding: 58px 8px 28px;
  }

  .portal-feedback {
    top: 14px;
    right: 8px;
  }

  .portal-logos {
    min-height: 42px;
  }

  .portal-logos img {
    width: 42px;
    height: 42px;
  }

  .portal-logos img:nth-child(3) {
    width: 74px;
  }

  .portal-hero h1 {
    width: 100%;
    margin: 6px auto 10px;
    font-size: clamp(19px, 5.5vw, 24px);
    line-height: 1.36;
    letter-spacing: 0;
  }

  .portal-hero p {
    font-size: 15px;
    line-height: 1.55;
  }

  .portal-actions {
    gap: 10px;
  }

  .portal-card {
    min-height: 92px;
    gap: 5px;
    padding: 14px 16px;
  }

  .portal-card strong {
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.3;
  }

  .portal-card span {
    font-size: 13px;
    line-height: 1.45;
  }

  .booking-time-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .booking-time-legend {
    gap: 7px 12px;
  }

  .booking-time-track {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .camera-recovery,
  .camera-recovery button {
    width: 100%;
  }
}
