:root {
  color-scheme: dark;
  --bg: #070707;
  --bg-2: #0e0c08;
  --panel: rgba(17, 16, 13, 0.92);
  --panel-strong: #12100c;
  --panel-soft: rgba(255, 248, 230, 0.055);
  --ink: #fff8e6;
  --muted: #b9ad91;
  --muted-2: #8e8269;
  --line: rgba(212, 175, 55, 0.24);
  --line-strong: rgba(245, 203, 92, 0.48);
  --accent: #d4af37;
  --accent-strong: #f5cb5c;
  --accent-soft: rgba(212, 175, 55, 0.14);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --ok: #34d399;
  --code: #050505;
  --shadow: 0 24px 72px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 48%, #050505 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(212, 175, 55, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(212, 175, 55, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), transparent 72%);
  animation: gridDrift 18s linear infinite;
}

a {
  color: #ffe08a;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

button,
.button-link {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 124px;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(135deg, #f5cb5c, #c89b2d);
  color: #11100d;
  box-shadow: 0 14px 30px rgba(212, 175, 55, 0.18);
  cursor: pointer;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 11px 22px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease,
    filter 160ms ease,
    background 160ms ease;
}

button::after,
.button-link::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.34) 46%, transparent 62%);
  transform: translateX(-130%);
  transition: transform 520ms ease;
}

button:hover,
.button-link:hover {
  border-color: var(--accent-strong);
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(212, 175, 55, 0.22);
}

button:hover::after,
.button-link:hover::after {
  transform: translateX(130%);
}

button:active,
.button-link:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button.ghost,
.ghost-link {
  background: rgba(255, 248, 230, 0.06);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}

button.ghost::after,
.ghost-link::after {
  background: linear-gradient(120deg, transparent, rgba(245, 203, 92, 0.14), transparent);
}

button.ghost:hover,
.ghost-link:hover {
  background: rgba(255, 248, 230, 0.095);
}

button.danger {
  background: linear-gradient(135deg, #ff5a5a, var(--danger));
  border-color: rgba(255, 112, 112, 0.8);
  color: #fff;
}

button.small {
  min-width: 92px;
  min-height: 36px;
  padding: 8px 16px;
  font-size: 13px;
}

button.wide {
  width: 100%;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(245, 203, 92, 0.78);
  outline-offset: 3px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 248, 230, 0.06);
  color: var(--ink);
  padding: 10px 12px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

input::placeholder {
  color: rgba(185, 173, 145, 0.72);
}

select {
  color-scheme: dark;
  cursor: pointer;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(245, 203, 92, 0.72);
  background: rgba(255, 248, 230, 0.085);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 52px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  align-items: center;
  gap: 20px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 7, 5, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 rgba(245, 203, 92, 0.16), 0 18px 50px rgba(0, 0, 0, 0.26);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(245, 203, 92, 0.2), rgba(212, 175, 55, 0.06));
  color: var(--accent-strong);
  font-weight: 950;
}

.brand strong {
  display: block;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.04);
}

.public-nav a {
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  padding: 8px 12px;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.public-nav a:hover {
  background: rgba(245, 203, 92, 0.12);
  color: var(--ink);
}

.session {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-shell {
  min-height: calc(100vh - 116px);
  display: grid;
  align-items: center;
}

.auth-landing {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.62fr);
  gap: 28px;
  align-items: center;
}

.auth-copy {
  max-width: 760px;
}

.auth-copy h1,
.workspace-hero h1,
.gallery-hero h1 {
  margin: 0;
  color: #fff4cf;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 1.06;
}

.auth-copy > p:not(.eyebrow),
.workspace-hero p:not(.eyebrow),
.gallery-hero p:not(.eyebrow) {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.flow-grid article {
  min-height: 134px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 248, 230, 0.045);
  padding: 16px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.flow-grid article:hover {
  border-color: rgba(245, 203, 92, 0.42);
  background: rgba(255, 248, 230, 0.07);
  transform: translateY(-2px);
}

.flow-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 28px;
  border: 1px solid rgba(245, 203, 92, 0.34);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(245, 203, 92, 0.11);
  font-size: 12px;
  font-weight: 900;
}

.flow-grid strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
}

.flow-grid p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel,
.panel,
.summary-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.public-sites {
  display: grid;
  gap: 16px;
  margin: 26px 0;
  border: 1px solid rgba(245, 203, 92, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 203, 92, 0.1), transparent 42%),
    rgba(17, 16, 13, 0.78);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section-head h2 {
  margin: 0;
  color: #fff4cf;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.section-head p:not(.eyebrow) {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.section-head code {
  border-radius: 5px;
  background: rgba(255, 248, 230, 0.1);
  color: #ffe8a3;
  padding: 2px 5px;
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.site-card {
  display: grid;
  align-content: space-between;
  min-height: 178px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 248, 230, 0.045);
  padding: 16px;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.site-card:hover {
  border-color: rgba(245, 203, 92, 0.42);
  background: rgba(255, 248, 230, 0.07);
  transform: translateY(-2px);
}

.site-card-head {
  display: grid;
  gap: 8px;
}

.site-card h3 {
  margin: 0;
  color: #fff4cf;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.site-user {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(245, 203, 92, 0.28);
  border-radius: 999px;
  background: rgba(245, 203, 92, 0.1);
  color: #ffe8a3;
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
  padding: 5px 9px;
}

.site-meta {
  margin: 16px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.site-rating-summary {
  margin: 14px 0 0;
  color: #ffe8a3;
  font-size: 15px;
  font-weight: 900;
}

.rating-box {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.rating-button {
  min-width: 0;
  min-height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.rating-button.active {
  border-color: var(--accent-strong);
  background: linear-gradient(135deg, rgba(245, 203, 92, 0.3), rgba(212, 175, 55, 0.14));
  color: #fff4cf;
}

.site-actions {
  display: flex;
  justify-content: flex-end;
}

.small-link {
  min-width: 104px;
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
}

.auth-panel {
  padding: 18px;
}

.auth-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 6px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 12px;
  background: rgba(255, 248, 230, 0.045);
}

.auth-switch {
  min-width: 0;
  min-height: 40px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 9px 14px;
}

.auth-switch::after {
  display: none;
}

.auth-switch.active,
.auth-switch:hover {
  background: linear-gradient(135deg, rgba(245, 203, 92, 0.22), rgba(212, 175, 55, 0.08));
  color: var(--ink);
  transform: none;
}

.auth-form {
  animation: panelIn 220ms ease both;
}

.form-title {
  margin-bottom: 12px;
}

.form-title h2,
.panel h2 {
  margin: 0;
  color: #fff4cf;
}

.form-title p:not(.eyebrow),
.panel-head p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.form-title code,
.panel-head code {
  border-radius: 5px;
  background: rgba(255, 248, 230, 0.1);
  color: #ffe8a3;
  padding: 2px 5px;
}

.message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.message.error {
  color: #ff8a8a;
}

.student-consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.student-consent input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.workspace {
  display: grid;
  gap: 18px;
}

.workspace-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(245, 203, 92, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 203, 92, 0.13), transparent 42%),
    rgba(17, 16, 13, 0.82);
  box-shadow: var(--shadow);
  padding: 24px;
}

.gallery-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  min-height: 260px;
  border: 1px solid rgba(245, 203, 92, 0.22);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(245, 203, 92, 0.14), transparent 46%),
    rgba(17, 16, 13, 0.84);
  box-shadow: var(--shadow);
  padding: 28px;
}

.gallery-hero code {
  border-radius: 5px;
  background: rgba(255, 248, 230, 0.1);
  color: #ffe8a3;
  padding: 2px 5px;
}

.gallery-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(100%, 360px);
}

.gallery-actions select {
  width: 180px;
  min-height: 44px;
  font-weight: 850;
}

.standalone-gallery {
  margin-top: 18px;
}

.feedback-page {
  width: min(860px, calc(100% - 32px));
}

.feedback-form-shell {
  display: grid;
  gap: 14px;
}

.feedback-hero-card,
.feedback-card {
  border: 1px solid rgba(212, 175, 55, 0.24);
  border-radius: 8px;
  background: rgba(17, 16, 13, 0.92);
  box-shadow: var(--shadow);
}

.feedback-hero-card {
  overflow: hidden;
  border-top: 8px solid var(--accent-strong);
  padding: 28px;
}

.feedback-hero-card h1 {
  margin: 0;
  color: #fff4cf;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
}

.feedback-hero-card p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.feedback-hero-card small {
  display: block;
  margin-top: 14px;
  color: #ffb4b4;
  font-weight: 800;
}

.feedback-form {
  display: grid;
  gap: 14px;
}

.feedback-card {
  padding: 22px;
}

.feedback-card h2 {
  margin: 0 0 16px;
  color: #fff4cf;
  font-size: 20px;
}

.feedback-member-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.feedback-card h2 span,
.feedback-card label span {
  color: #ff8a8a;
}

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

.choice-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--ink);
  font-weight: 650;
  line-height: 1.45;
}

.choice-list input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent-strong);
}

.inline-choice {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 20px;
}

.question-label {
  margin-top: 0;
  color: var(--ink);
  font-size: 16px;
}

.rating-question {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid rgba(212, 175, 55, 0.16);
}

.rating-question:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.rating-question p {
  margin: 0;
  color: var(--ink);
  font-weight: 760;
}

.linear-scale {
  display: flex;
  align-items: center;
  gap: 6px;
}

.linear-scale label {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  width: 46px;
  min-height: 46px;
  place-items: center;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.linear-scale label:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 8px 16px rgba(245, 203, 92, 0.18));
}

.linear-scale label.active span {
  color: #f5cb5c;
  -webkit-text-fill-color: #f5cb5c;
  text-shadow: 0 0 18px rgba(245, 203, 92, 0.35);
}

.linear-scale label:has(input:focus-visible) {
  outline: 2px solid rgba(245, 203, 92, 0.8);
  outline-offset: 3px;
}

.linear-scale input {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  min-height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.linear-scale span {
  color: #6f6a5f;
  -webkit-text-fill-color: #6f6a5f;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  text-shadow: none;
  transition:
    color 160ms ease,
    -webkit-text-fill-color 160ms ease,
    text-shadow 160ms ease,
    transform 160ms ease;
}

.linear-scale label:hover span {
  color: #b8ae95;
  -webkit-text-fill-color: #b8ae95;
  transform: scale(1.08);
}

.linear-scale label.active:hover span {
  color: #f5cb5c;
  -webkit-text-fill-color: #f5cb5c;
}

.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 4px 0 28px;
}

.workspace-hero h1 {
  font-size: clamp(32px, 4vw, 54px);
}

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

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid rgba(245, 203, 92, 0.32);
  border-radius: 999px;
  background: rgba(245, 203, 92, 0.1);
  color: #ffe8a3;
  font-weight: 850;
  padding: 9px 14px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.dashboard-nav {
  position: sticky;
  top: 72px;
  z-index: 12;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(8, 7, 5, 0.82);
  backdrop-filter: blur(14px);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.3);
}

.tab {
  min-width: 128px;
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 10px 18px;
}

.tab::after {
  display: none;
}

.tab:hover,
.tab.active {
  background: rgba(245, 203, 92, 0.13);
  color: var(--ink);
  transform: translateY(-1px);
}

.tab-panel {
  animation: panelIn 220ms ease both;
}

.summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr) minmax(220px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

.summary-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.summary-card:hover,
.panel:hover {
  border-color: rgba(245, 203, 92, 0.42);
  background: rgba(20, 18, 14, 0.96);
  transform: translateY(-2px);
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.summary-card strong {
  color: var(--ink);
  font-size: 24px;
}

.summary-card small {
  color: var(--muted);
}

.summary-card a {
  overflow: hidden;
  color: #ffe8a3;
  font-size: 20px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.48fr);
  gap: 14px;
}

.site-manager-panel {
  margin-top: 14px;
}

.site-manager-top {
  margin-top: 0;
}

.site-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.subdomain-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  border: 1px solid rgba(245, 203, 92, 0.32);
  border-radius: 10px;
  background: rgba(255, 248, 230, 0.07);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.subdomain-field:focus-within {
  border-color: rgba(245, 203, 92, 0.75);
  box-shadow: 0 0 0 3px rgba(245, 203, 92, 0.12);
}

.subdomain-field input {
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.subdomain-field span {
  display: inline-flex;
  align-items: center;
  min-height: 100%;
  border-left: 1px solid rgba(245, 203, 92, 0.22);
  background: rgba(245, 203, 92, 0.08);
  color: #ffe8a3;
  font-weight: 900;
  padding: 0 14px;
  white-space: nowrap;
}

.member-sites {
  display: grid;
  gap: 10px;
}

.member-site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 248, 230, 0.045);
  padding: 12px;
}

.member-site strong {
  color: #fff4cf;
}

.member-site.active {
  border-color: var(--accent-strong);
  background: rgba(245, 203, 92, 0.1);
}

.member-site-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.panel {
  min-width: 0;
  padding: 18px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.panel-head {
  margin-bottom: 16px;
}

.row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 248, 230, 0.12);
}

.meter span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #f5cb5c);
  transition: width 360ms ease;
}

.token-box {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(245, 203, 92, 0.2);
  border-radius: 10px;
  background: rgba(255, 248, 230, 0.045);
}

.token-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.token-box code {
  color: #ffe8a3;
  overflow-wrap: anywhere;
}

.command {
  min-height: 108px;
  overflow-x: auto;
  margin: 0 0 14px;
  border: 1px solid rgba(245, 203, 92, 0.18);
  border-radius: 10px;
  background: var(--code);
  color: #ffe8a3;
  padding: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 248, 230, 0.05);
}

.command-actions,
.stack-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.command-actions {
  justify-content: flex-end;
}

.stack-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.stack-actions button {
  width: 100%;
  min-height: 48px;
}

.safety-note {
  margin-top: 16px;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: 12px;
  background: var(--danger-soft);
  padding: 13px;
}

.safety-note strong {
  color: #fecaca;
}

.safety-note p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(17, 16, 13, 0.82);
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 14px;
}

td:last-child {
  width: 1%;
  white-space: nowrap;
}

th {
  background: rgba(255, 248, 230, 0.045);
  color: var(--muted);
  font-weight: 850;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: rgba(255, 248, 230, 0.05);
}

.path-cell {
  max-width: 520px;
  overflow-wrap: anywhere;
  padding-left: calc(14px + (var(--depth, 0) * 20px));
}

.folder-row {
  background: rgba(255, 248, 230, 0.025);
}

.tree-name,
.file-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 8px;
}

.folder-name {
  color: #f5d879;
  font-weight: 900;
}

.file-link {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #ffe8a3;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  line-height: 1.35;
  padding: 3px 6px;
  text-align: left;
  white-space: normal;
}

.file-link::before {
  content: "檔案";
  color: var(--muted);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 800;
}

.file-link::after {
  display: none;
}

.file-link:hover {
  background: rgba(245, 203, 92, 0.12);
  box-shadow: none;
  color: #fff4cf;
  transform: none;
}

.empty {
  margin: 14px 0 0;
  color: var(--muted);
}

.guide-panel {
  padding-bottom: 22px;
}

.prompt-panel {
  padding-bottom: 22px;
}

.prompt-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.prompt-form {
  display: grid;
  gap: 2px;
}

.prompt-output {
  min-height: 620px;
  background: #050505;
  color: #ffe8a3;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.guide-hero {
  margin-bottom: 16px;
  border: 1px solid rgba(245, 203, 92, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(245, 203, 92, 0.13), transparent 38%),
    rgba(255, 248, 230, 0.04);
  padding: 18px;
}

.guide-hero h3 {
  margin: 4px 0 0;
  color: #fff4cf;
  font-size: 22px;
  line-height: 1.35;
}

.guide-steps,
.guide-grid {
  display: grid;
  gap: 14px;
}

.guide-steps {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.simple-guide-steps {
  align-items: stretch;
}

.guide-card,
.guide-tip,
.guide-command {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 248, 230, 0.045);
}

.guide-card,
.guide-tip {
  padding: 16px;
}

.guide-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: 30px;
  margin-bottom: 12px;
  border: 1px solid rgba(245, 203, 92, 0.32);
  border-radius: 999px;
  color: var(--accent-strong);
  background: rgba(245, 203, 92, 0.1);
  font-size: 13px;
  font-weight: 950;
  padding: 0 12px;
}

.guide-card h3,
.guide-tip h3,
.guide-command h3 {
  margin: 0 0 8px;
  color: #fff4cf;
  font-size: 17px;
}

.guide-card p,
.guide-tip p,
.guide-command p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.simple-guide-steps .guide-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 250px;
}

.simple-guide-steps .guide-card h3 {
  font-size: 22px;
}

.simple-guide-steps .guide-card p {
  font-size: 16px;
}

.simple-command {
  min-width: 0;
  max-height: 150px;
  overflow: auto;
  margin: 6px 0 2px;
  border: 1px solid rgba(245, 203, 92, 0.22);
  border-radius: 10px;
  background: #050505;
  color: #ffe8a3;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 12px;
}

.codex-task {
  max-height: 260px;
}

.simple-guide-steps button {
  width: 100%;
  min-height: 46px;
  margin-top: 2px;
}

.guide-command {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
}

.guide-command pre {
  min-width: 0;
  overflow-x: auto;
  margin: 0;
  border: 1px solid rgba(245, 203, 92, 0.16);
  border-radius: 10px;
  background: #050505;
  color: #ffe8a3;
  padding: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.guide-tip code,
.guide-card code,
.guide-command code,
.guide-hero code {
  border-radius: 5px;
  background: rgba(255, 248, 230, 0.1);
  color: #ffe8a3;
  padding: 2px 5px;
}

.guide-tip > code {
  display: inline-block;
  margin-top: 10px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(245, 203, 92, 0.36);
  border-radius: 14px;
  background: #11100d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 248, 230, 0.05);
}

.modal-head h2 {
  max-width: 720px;
  margin: 0;
  color: #fff4cf;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.modal-body {
  min-height: 240px;
  overflow: auto;
  padding: 18px;
}

.first-site-card {
  width: min(640px, 100%);
}

.first-site-body {
  min-height: 0;
}

.first-site-body > p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: 620px;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.preview-code {
  min-height: 100%;
  margin: 0;
  overflow: auto;
  border: 1px solid rgba(245, 203, 92, 0.16);
  border-radius: 10px;
  background: #050505;
  color: #f7efd7;
  padding: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.hidden {
  display: none !important;
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 56px 56px, 56px 56px;
  }
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: 1fr auto;
    gap: 10px 14px;
  }

  .public-nav {
    display: flex;
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .public-nav::-webkit-scrollbar {
    display: none;
  }

  .public-nav a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .auth-landing,
  .overview-layout,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    width: min(560px, 100%);
  }
}

@media (max-width: 820px) {
  main {
    width: min(100% - 24px, 1240px);
    padding-top: 18px;
  }

  .topbar,
  .workspace-hero,
  .gallery-hero,
  .row-head {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .session,
  .workspace-actions {
    justify-content: flex-start;
  }

  .session {
    flex-wrap: wrap;
  }

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

  .auth-copy h1 {
    font-size: 38px;
  }

  .flow-grid,
  .site-grid,
  .rating-box,
  .prompt-layout,
  .site-create-row,
  .guide-steps,
  .guide-grid,
  .guide-command {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .dashboard-nav {
    top: 70px;
  }

  button,
  .button-link {
    min-width: 0;
  }

  .command-actions button,
  .row-head > button,
  .gallery-actions,
  .gallery-actions select,
  .site-create-row button,
  .site-actions .button-link,
  .workspace-actions .button-link {
    width: 100%;
  }

  .site-actions {
    justify-content: stretch;
  }

  .command-actions {
    justify-content: stretch;
  }
}

@media (max-width: 520px) {
  .auth-copy h1,
  .workspace-hero h1,
  .gallery-hero h1 {
    font-size: 32px;
  }

  .auth-panel,
  .panel,
  .summary-card,
  .workspace-hero,
  .gallery-hero {
    border-radius: 12px;
    padding: 15px;
  }

  th,
  td {
    white-space: nowrap;
  }
}
