:root {
  color-scheme: dark;
  --bg: #090c0d;
  --bg-deep: #07090a;
  --surface: #111516;
  --surface-soft: #15191a;
  --surface-raised: #191d1e;
  --text: #f1ece3;
  --text-soft: #c7bfb4;
  --muted: #8d8982;
  --faint: #656661;
  --gold: #d9ab76;
  --gold-bright: #efc994;
  --gold-dark: #896b4a;
  --gold-wash: rgba(217, 171, 118, 0.09);
  --line: rgba(224, 188, 139, 0.2);
  --soft-line: rgba(255, 255, 255, 0.085);
  --danger: #e06155;
  --danger-soft: rgba(224, 97, 85, 0.11);
  --success: #8db68a;
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 78% 3%, rgba(170, 126, 72, 0.06), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

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

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

.boot-screen {
  min-height: 100svh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.boot-mark {
  position: relative;
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 22px;
  animation: bootPulse 1.5s ease-in-out infinite;
}

@keyframes bootPulse {
  50% { box-shadow: 0 0 28px rgba(217, 171, 118, 0.2); }
}

.brand {
  display: inline-grid;
  align-content: center;
  min-width: max-content;
}

.brand strong {
  font-family: var(--serif);
  color: var(--gold-bright);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.brand small {
  margin-top: 3px;
  color: var(--gold-dark);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.27em;
}

/* Login */
.login-view {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(560px, 1.1fr);
  background: var(--bg-deep);
}

.login-story {
  position: relative;
  isolation: isolate;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 38px clamp(34px, 4.5vw, 76px) 68px;
  border-right: 1px solid var(--line);
}

.login-story::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: url("./assets/hero-desk.jpg") 61% bottom / auto 140% no-repeat;
  filter: saturate(0.68) contrast(1.07);
  transform: scale(1.03);
}

.login-story::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 9, 10, 0.9) 0%, rgba(6, 9, 10, 0.37) 38%, rgba(6, 9, 10, 0.88) 100%),
    linear-gradient(90deg, rgba(6, 9, 10, 0.25), rgba(6, 9, 10, 0.04));
}

.brand--login strong {
  color: #f0c890;
  font-size: 26px;
}

.login-story__copy {
  max-width: 620px;
}

.login-story__copy > p {
  margin: 0 0 20px;
  color: var(--gold);
  font-family: var(--serif);
  letter-spacing: 0.25em;
}

.login-story__copy h1 {
  margin: 0;
  color: #f5efe5;
  font-family: var(--serif);
  font-size: clamp(38px, 4.3vw, 67px);
  font-weight: 400;
  letter-spacing: 0.035em;
  line-height: 1.35;
  text-wrap: balance;
}

.login-story__copy > span {
  display: block;
  margin-top: 24px;
  color: rgba(232, 225, 215, 0.66);
  font-size: 13px;
  letter-spacing: 0.06em;
}

.login-panel {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 80px clamp(30px, 7vw, 128px);
  background:
    radial-gradient(circle at 48% 52%, rgba(217, 171, 118, 0.055), transparent 23rem),
    #0b0e0f;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 30px;
  pointer-events: none;
  border: 1px solid rgba(217, 171, 118, 0.08);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(470px, 100%);
}

.login-home {
  position: absolute;
  bottom: calc(100% + 72px);
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  transition: color 180ms ease;
}

.login-home svg {
  width: 17px;
  height: 17px;
}

.login-home:hover {
  color: var(--gold-bright);
}

.login-heading {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 42px;
}

.seal {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(224, 188, 139, 0.48);
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 25px;
  box-shadow: inset 0 0 0 5px rgba(217, 171, 118, 0.035);
}

.login-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(34px, 3vw, 44px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.login-heading p {
  margin: 6px 0 0;
  color: var(--muted);
}

.login-form > label {
  display: block;
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 52px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
}

.password-toggle .eye-closed,
.password-toggle[aria-pressed="true"] .eye-open {
  display: none;
}

.password-toggle[aria-pressed="true"] .eye-closed {
  display: block;
}

.field-message {
  min-height: 24px;
  margin: 8px 0 12px;
  color: var(--danger);
  font-size: 12px;
}

/* Controls */
input,
textarea {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 7px;
  outline: 0;
  background: rgba(255, 255, 255, 0.022);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

input {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 96px;
  padding: 12px 14px 28px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #656761;
}

input:hover,
textarea:hover {
  border-color: rgba(224, 188, 139, 0.28);
}

input:focus,
textarea:focus {
  border-color: rgba(239, 201, 148, 0.65);
  background: rgba(217, 171, 118, 0.035);
  box-shadow: 0 0 0 3px rgba(217, 171, 118, 0.08);
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
.cover-option:has(input:focus-visible) {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: transform 180ms var(--ease), background 180ms ease, border-color 180ms ease, color 180ms ease, opacity 180ms ease;
}

.button svg {
  width: 18px;
  height: 18px;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.button--wide {
  width: 100%;
}

.button--primary {
  border-color: #ecc28e;
  background: linear-gradient(135deg, #edc38f, #d9aa72);
  color: #1a1611;
  box-shadow: 0 10px 30px rgba(208, 157, 95, 0.14);
}

.button--primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #f4d3aa, #e1b47f);
  box-shadow: 0 13px 34px rgba(208, 157, 95, 0.21);
}

.button--soft {
  min-width: 140px;
  border-color: rgba(231, 191, 140, 0.6);
  background: rgba(217, 171, 118, 0.08);
  color: var(--gold-bright);
}

.button--soft:hover {
  border-color: var(--gold-bright);
  background: rgba(217, 171, 118, 0.14);
}

.button--outline {
  border-color: var(--soft-line);
  background: transparent;
  color: var(--text-soft);
}

.button--outline:hover {
  border-color: rgba(224, 188, 139, 0.4);
  color: var(--gold-bright);
}

.button--danger {
  border-color: rgba(224, 97, 85, 0.56);
  background: transparent;
  color: #ee766b;
}

.button--danger:hover {
  background: var(--danger-soft);
}

.button--danger-fill {
  border-color: #e36a5f;
  background: #c94e44;
  color: #fff4f2;
}

.button--danger-fill:hover:not(:disabled) {
  background: #df5d52;
}

.icon-only {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease;
}

.icon-only:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--gold-bright);
}

.icon-only svg {
  width: 19px;
  height: 19px;
}

/* Studio shell */
.studio {
  min-height: 100vh;
}

.studio-header {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 64px);
  border-bottom: 1px solid var(--soft-line);
  background: rgba(9, 12, 13, 0.88);
  backdrop-filter: blur(18px);
}

.studio-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
  font-size: 12px;
  transition: color 180ms ease;
}

.header-action:hover {
  color: var(--gold-bright);
}

.header-action svg {
  width: 17px;
  height: 17px;
  color: var(--gold);
}

.header-divider {
  width: 1px;
  height: 20px;
  background: var(--soft-line);
}

.studio-main {
  width: min(1440px, calc(100% - 64px));
  margin: 0 auto;
  padding: 54px 0 100px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 3.4vw, 50px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.25;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.session-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.session-state span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(141, 182, 138, 0.09);
}

.workspace,
.queue-section,
.content-section,
.danger-section {
  border: 1px solid var(--soft-line);
  background: rgba(17, 21, 22, 0.72);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.13);
}

.workspace {
  overflow: hidden;
}

.workspace-heading,
.section-title-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255, 255, 255, 0.012);
}

.workspace-heading > div,
.section-title-row > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.workspace-heading h2,
.section-title-row h2,
.danger-section h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.workspace-heading > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.section-index {
  color: var(--gold-dark);
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.14em;
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(350px, 0.9fr) minmax(520px, 1.25fr);
}

.drop-column {
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--soft-line);
}

.drop-zone {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: 36px;
  border: 1px dashed rgba(224, 188, 139, 0.46);
  background:
    radial-gradient(circle at center, rgba(217, 171, 118, 0.045), transparent 55%),
    rgba(255, 255, 255, 0.012);
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms ease, background 200ms ease, transform 200ms var(--ease);
}

.drop-zone::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  border: 1px solid rgba(224, 188, 139, 0.04);
}

.drop-zone:hover,
.drop-zone.is-dragging {
  border-color: var(--gold-bright);
  background:
    radial-gradient(circle at center, rgba(217, 171, 118, 0.1), transparent 60%),
    rgba(217, 171, 118, 0.035);
}

.drop-zone.is-dragging {
  transform: scale(0.995);
}

.drop-zone.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
  animation: shake 300ms ease;
}

@keyframes shake {
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.upload-glyph {
  width: 68px;
  height: 78px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  color: var(--gold-bright);
}

.upload-glyph svg {
  width: 62px;
  height: 62px;
  stroke-width: 1.25;
}

.drop-zone > strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.drop-zone > p {
  max-width: 340px;
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.selected-file {
  position: relative;
  z-index: 2;
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  margin-top: 22px;
  padding: 10px 10px 10px 12px;
  border: 1px solid rgba(224, 188, 139, 0.22);
  border-radius: 7px;
  background: rgba(5, 8, 9, 0.65);
  text-align: left;
}

.selected-file__icon,
.file-type {
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(224, 188, 139, 0.28);
  border-radius: 5px;
  background: rgba(217, 171, 118, 0.07);
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.03em;
}

.selected-file__name {
  overflow: hidden;
  color: var(--text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file__size {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.selected-file__remove {
  width: 32px;
  height: 32px;
}

.metadata-column {
  min-width: 0;
  padding: 26px;
}

.field-group {
  position: relative;
  min-width: 0;
}

.field-group label,
.cover-fieldset legend {
  display: block;
  margin-bottom: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.field-group label > span {
  margin-left: 6px;
  color: var(--faint);
  font-size: 10px;
}

.field-group label > span[aria-hidden="true"] {
  margin-left: 2px;
  color: var(--gold);
}

.field-group--full {
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(170px, 0.75fr) minmax(260px, 1.25fr);
  gap: 16px;
}

.counter {
  position: absolute;
  right: 11px;
  bottom: 8px;
  color: var(--faint);
  font-size: 9px;
}

.cover-fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.cover-options {
  display: grid;
  grid-template-columns: repeat(6, minmax(74px, 1fr));
  gap: 8px;
}

.cover-option {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 6px;
  background: #0c0f10;
  cursor: pointer;
  transition: border-color 180ms ease, transform 180ms var(--ease), box-shadow 180ms ease;
}

.cover-option:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 188, 139, 0.38);
}

.cover-option:has(input:checked) {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(239, 201, 148, 0.2);
}

.cover-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.cover-image {
  position: relative;
  display: block;
  aspect-ratio: 1.45;
  background-position: center;
  background-size: cover;
  filter: saturate(0.78) brightness(0.78);
}

.cover-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 7, 8, 0.55), transparent 72%);
}

.cover-option--bing .cover-image { background-image: url("./assets/hero-desk.jpg"); }
.cover-option--study .cover-image { background-image: url("./assets/study.jpg"); }
.cover-option--essay .cover-image { background-image: url("./assets/essay.jpg"); }
.cover-option--growth .cover-image { background-image: url("./assets/growth.jpg"); }
.cover-option--life .cover-image { background-image: url("./assets/life.jpg"); }
.cover-option--more .cover-image { background-image: url("./assets/more.jpg"); }

.cover-label {
  display: block;
  overflow: hidden;
  padding: 8px 8px 9px;
}

.cover-label strong,
.cover-label small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cover-label strong {
  color: var(--text-soft);
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 400;
}

.cover-label small {
  color: var(--faint);
  font-size: 8px;
}

.cover-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 17px;
  height: 17px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--gold-bright);
  color: #17120d;
  font-size: 10px;
  font-weight: 700;
}

.cover-option:has(input:checked) .cover-check {
  display: grid;
}

.form-actions {
  min-height: 65px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
}

.form-actions .form-message {
  flex: 1;
  margin: 0;
  color: var(--danger);
  font-size: 11px;
}

.form-actions .button {
  min-width: 178px;
}

/* Queue */
.queue-section,
.content-section,
.danger-section {
  margin-top: 22px;
}

.upload-queue {
  display: grid;
}

.queue-item {
  display: grid;
  grid-template-columns: minmax(250px, 1fr) minmax(220px, 1.3fr) 120px;
  align-items: center;
  gap: 26px;
  min-height: 74px;
  padding: 12px 20px;
  border-top: 1px solid var(--soft-line);
}

.queue-item:first-child {
  border-top: 0;
}

.queue-file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-file__copy {
  min-width: 0;
}

.queue-file__copy strong,
.queue-file__copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-file__copy strong {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
}

.queue-file__copy span {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}

.progress-shell {
  min-width: 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-bright));
  transition: width 100ms linear;
}

.queue-status {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.queue-status.is-success {
  color: var(--success);
}

.queue-status.is-error {
  color: var(--danger);
}

/* Content list */
.item-count {
  min-width: 24px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--gold);
  font-size: 9px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
}

.text-button:hover {
  color: var(--gold-bright);
}

.text-button svg {
  width: 16px;
  height: 16px;
}

.text-button.is-loading svg {
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.content-shell {
  min-height: 170px;
}

.list-state {
  min-height: 190px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.list-state h3 {
  margin: 13px 0 2px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 400;
}

.list-state p {
  max-width: 520px;
  margin: 2px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(217, 171, 118, 0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.empty-glyph {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--gold-dark);
  font-family: var(--serif);
}

.list-state--error .empty-glyph {
  border-color: rgba(224, 97, 85, 0.35);
  color: var(--danger);
}

.content-table-wrap {
  overflow-x: auto;
}

.content-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.content-table th {
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.content-table th:nth-child(1) { width: 29%; }
.content-table th:nth-child(2) { width: 12%; }
.content-table th:nth-child(3) { width: 10%; }
.content-table th:nth-child(4) { width: 15%; }
.content-table th:nth-child(5) { width: 23%; }
.content-table th:nth-child(6) { width: 11%; }

.content-table td {
  height: 68px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--text-soft);
  font-size: 11px;
  vertical-align: middle;
}

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

.content-table tbody tr {
  transition: background 160ms ease;
}

.content-table tbody tr:hover {
  background: rgba(217, 171, 118, 0.025);
}

.content-file {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.content-file > div {
  min-width: 0;
}

.content-file strong,
.content-file small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-file strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 500;
}

.content-file small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
}

.file-type--pdf { color: #e07a6f; border-color: rgba(224, 122, 111, 0.34); background: rgba(224, 122, 111, 0.08); }
.file-type--doc { color: #7ba8dc; border-color: rgba(123, 168, 220, 0.34); background: rgba(123, 168, 220, 0.08); }
.file-type--sheet { color: #79b487; border-color: rgba(121, 180, 135, 0.34); background: rgba(121, 180, 135, 0.08); }
.file-type--slide { color: #d49465; border-color: rgba(212, 148, 101, 0.34); background: rgba(212, 148, 101, 0.08); }
.file-type--image { color: #9eb876; border-color: rgba(158, 184, 118, 0.34); background: rgba(158, 184, 118, 0.08); }
.file-type--audio { color: #a792d6; border-color: rgba(167, 146, 214, 0.34); background: rgba(167, 146, 214, 0.08); }
.file-type--video { color: #8c92df; border-color: rgba(140, 146, 223, 0.34); background: rgba(140, 146, 223, 0.08); }

.category-text,
.muted-cell {
  overflow: hidden;
  display: block;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-text {
  color: var(--gold);
}

.share-link {
  display: block;
  overflow: hidden;
  color: var(--gold);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-link:hover {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
}

.row-action {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease;
}

.row-action:hover {
  background: rgba(217, 171, 118, 0.08);
  color: var(--gold-bright);
}

.row-action--delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.row-action svg {
  width: 16px;
  height: 16px;
}

/* Danger */
.danger-section {
  min-height: 116px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 24px;
  border-color: rgba(224, 97, 85, 0.2);
  background: linear-gradient(90deg, rgba(224, 97, 85, 0.035), transparent 42%);
}

.danger-section > div {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 13px;
}

.danger-section p {
  grid-column: 2;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.studio-footer {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(24px, 4vw, 64px);
  border-top: 1px solid var(--soft-line);
  color: var(--faint);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.04em;
}

/* Clear confirmation */
.clear-dialog {
  width: min(520px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100svh - 32px);
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 1px solid rgba(224, 97, 85, 0.35);
  background: #111516;
  color: var(--text);
  box-shadow: 0 35px 110px rgba(0, 0, 0, 0.7);
}

.clear-dialog::backdrop {
  background: rgba(2, 4, 5, 0.82);
  backdrop-filter: blur(12px);
}

.clear-dialog[open] {
  animation: dialogIn 260ms var(--ease);
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(15px) scale(0.98); }
}

.clear-dialog__card {
  position: relative;
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 38px;
}

.dialog-close {
  position: absolute;
  top: 13px;
  right: 13px;
}

.warning-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid rgba(224, 97, 85, 0.52);
  border-radius: 50%;
  background: var(--danger-soft);
  color: var(--danger);
  font-family: Georgia, serif;
  font-size: 22px;
}

.clear-dialog h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.clear-dialog h2 + p {
  margin: 10px 0 24px;
  color: var(--muted);
  font-size: 12px;
}

.clear-dialog .field-group + .field-group {
  margin-top: 16px;
}

.field-message--center {
  margin-bottom: 4px;
  text-align: center;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

/* Toast */
.toast-region {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: min(390px, calc(100vw - 40px));
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(22, 27, 27, 0.96);
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 200ms ease, transform 260ms var(--ease);
}

.toast-region.is-visible {
  opacity: 1;
  transform: none;
}

.toast-region.is-error {
  border-color: rgba(224, 97, 85, 0.45);
  color: #f1aaa4;
}

@media (max-width: 1100px) {
  .login-view {
    grid-template-columns: minmax(360px, 0.82fr) minmax(500px, 1.18fr);
  }

  .login-story {
    padding-inline: 38px;
  }

  .login-story__copy h1 {
    font-size: 43px;
  }

  .studio-main {
    width: min(100% - 40px, 1120px);
  }

  .upload-form {
    grid-template-columns: minmax(320px, 0.78fr) minmax(470px, 1.22fr);
  }

  .cover-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .content-table th:nth-child(1) { width: 30%; }
  .content-table th:nth-child(4) { width: 16%; }
  .content-table th:nth-child(5) { width: 20%; }
}

@media (max-width: 820px) {
  .login-view {
    grid-template-columns: 1fr;
  }

  .login-story {
    min-height: 37svh;
    padding: 25px 28px 32px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .login-story::before {
    background-position: 61% bottom;
    background-size: auto 220%;
  }

  .login-story::after {
    background: linear-gradient(180deg, rgba(6, 9, 10, 0.65), rgba(6, 9, 10, 0.85));
  }

  .login-story__copy > p,
  .login-story__copy > span {
    display: none;
  }

  .login-story__copy h1 {
    font-size: clamp(28px, 7vw, 42px);
  }

  .login-panel {
    min-height: 63svh;
    padding: 54px 28px;
  }

  .login-panel::before {
    inset: 16px;
  }

  .login-home {
    display: none;
  }

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

  .drop-column {
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .drop-zone {
    min-height: 330px;
  }

  .queue-item {
    grid-template-columns: minmax(210px, 1fr) minmax(180px, 1fr);
    gap: 16px;
  }

  .queue-status {
    grid-column: 2;
  }

  .content-table {
    min-width: 850px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 13px;
  }

  .brand strong {
    font-size: 19px;
  }

  .brand small {
    display: none;
  }

  .login-story {
    min-height: 32svh;
    padding: 20px 21px 25px;
  }

  .brand--login strong {
    font-size: 21px;
  }

  .login-story__copy h1 {
    font-size: clamp(27px, 8vw, 36px);
    line-height: 1.36;
  }

  .login-panel {
    min-height: 68svh;
    place-items: start center;
    padding: 52px 24px 44px;
  }

  .login-panel::before {
    display: none;
  }

  .login-heading {
    gap: 14px;
    margin-bottom: 30px;
  }

  .seal {
    width: 47px;
    height: 47px;
    font-size: 21px;
  }

  .login-heading h1 {
    font-size: 31px;
  }

  .studio-header {
    height: 64px;
    padding: 0 18px;
  }

  .studio-actions {
    gap: 7px;
  }

  .header-action {
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
  }

  .header-action span,
  .header-divider {
    display: none;
  }

  .header-action:hover {
    background: rgba(217, 171, 118, 0.07);
  }

  .studio-main {
    width: calc(100% - 28px);
    padding: 35px 0 70px;
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 23px;
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .page-heading p {
    max-width: 260px;
    font-size: 11px;
  }

  .session-state {
    margin-top: 6px;
    font-size: 0;
  }

  .workspace-heading,
  .section-title-row {
    min-height: 63px;
    padding: 12px 15px;
  }

  .workspace-heading > p {
    display: none;
  }

  .workspace-heading h2,
  .section-title-row h2,
  .danger-section h2 {
    font-size: 18px;
  }

  .drop-column {
    padding: 10px;
  }

  .drop-zone {
    min-height: 320px;
    padding: 30px 17px;
  }

  .upload-glyph {
    width: 55px;
    height: 60px;
    margin-bottom: 14px;
  }

  .upload-glyph svg {
    width: 54px;
    height: 54px;
  }

  .drop-zone > strong {
    font-size: 21px;
  }

  .selected-file {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .selected-file__size {
    display: none;
  }

  .metadata-column {
    padding: 20px 15px;
  }

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

  .cover-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin-top: 19px;
  }

  .form-actions .form-message {
    min-height: 0;
  }

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

  .queue-section,
  .content-section,
  .danger-section {
    margin-top: 15px;
  }

  .queue-item {
    grid-template-columns: 1fr;
    gap: 13px;
    padding: 15px;
  }

  .queue-status {
    grid-column: auto;
    justify-self: start;
  }

  .content-table-wrap {
    overflow: visible;
    padding: 10px;
  }

  .content-table,
  .content-table tbody,
  .content-table tr,
  .content-table td {
    display: block;
    width: 100%;
  }

  .content-table {
    min-width: 0;
  }

  .content-table thead {
    display: none;
  }

  .content-table tr {
    position: relative;
    margin-bottom: 9px;
    padding: 14px 13px 11px;
    border: 1px solid var(--soft-line);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.014);
  }

  .content-table tr:last-child {
    margin-bottom: 0;
  }

  .content-table td {
    height: auto;
    min-height: 0;
    padding: 5px 0;
    border: 0;
  }

  .content-table td:not(:first-child, :last-child) {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .content-table td:not(:first-child, :last-child)::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 10px;
  }

  .content-table td:first-child {
    padding-right: 74px;
    margin-bottom: 7px;
  }

  .content-table td:last-child {
    position: absolute;
    top: 14px;
    right: 10px;
    width: auto;
  }

  .row-actions {
    gap: 0;
  }

  .danger-section {
    align-items: stretch;
    flex-direction: column;
    padding: 19px 15px;
  }

  .danger-section > div {
    grid-template-columns: auto 1fr;
  }

  .danger-section p {
    line-height: 1.7;
  }

  .danger-section .button {
    width: 100%;
  }

  .studio-footer {
    justify-content: center;
    padding-inline: 18px;
    text-align: center;
  }

  .studio-footer span:last-child {
    display: none;
  }

  .clear-dialog__card {
    padding: 33px 22px 23px;
  }

  .clear-dialog h2 {
    font-size: 23px;
  }

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

  .toast-region {
    right: 20px;
    left: 20px;
    max-width: none;
    text-align: center;
  }
}

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