:root {
  --ink: #0f1620;
  --ink-soft: #1c2733;
  --slate: #5d6979;
  --fog: #f4f7fb;
  --mist: #e9eef5;
  --line: rgba(15, 22, 32, 0.1);
  --teal: #176f66;
  --gold: #ea9b3f;
  --danger: #9d2f3f;
  --white: #ffffff;
  --shadow: 0 24px 60px rgba(12, 18, 28, 0.14);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  background:
    radial-gradient(900px 460px at 8% 12%, rgba(23, 111, 102, 0.14), transparent 60%),
    radial-gradient(720px 420px at 94% 0%, rgba(234, 155, 63, 0.16), transparent 60%),
    linear-gradient(180deg, #f8fafc 0%, #ecf1f7 100%);
}

a { color: inherit; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  color: var(--white);
  background:
    radial-gradient(640px 360px at 10% 18%, rgba(23, 111, 102, 0.38), transparent 58%),
    radial-gradient(540px 300px at 92% 10%, rgba(234, 155, 63, 0.32), transparent 55%),
    linear-gradient(135deg, #0b1219 0%, #101925 52%, #0c141c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner,
.main {
  width: min(1120px, calc(100vw - 2.4rem));
  margin: 0 auto;
}

.topbar-inner {
  padding: 1.6rem 0 2rem;
  display: grid;
  gap: 1.2rem;
  position: relative;
}

.topbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.dashboard-topbar-row {
  position: relative;
}

.login-topbar-row {
  justify-content: center;
}

.login-topbar-row .brand {
  width: 100%;
  justify-content: center;
}

.login-topbar-row .brand-badge-image {
  width: clamp(170px, 24vw, 250px);
  height: auto;
  border-radius: 0;
  filter: drop-shadow(0 14px 28px rgba(5, 10, 16, 0.22));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 700;
}

.brand-badge {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 0.96rem;
}

.brand-badge-image {
  object-fit: contain;
  padding: 0;
  background: transparent;
  border-radius: 10px;
}

.dashboard-topbar-row .brand-badge {
  width: auto;
  height: auto;
  padding: 0;
  display: block;
  border-radius: 0;
  background: transparent;
}

.dashboard-topbar-row .brand-badge-image {
  height: 30px;
  width: auto;
  max-width: min(52vw, 340px);
  display: block;
}

.topbar-logout,
.menu-toggle {
  display: none;
}

.topbar-logout {
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.84);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--white);
}

.mobile-menu {
  display: none;
}

.mobile-menu.is-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  padding: 0.9rem 0 0;
  border-radius: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-width: 1px 0 0;
  box-shadow: none;
  backdrop-filter: none;
  width: 100%;
  position: static;
  z-index: auto;
}

.mobile-menu-head {
  grid-column: 1 / -1;
  padding: 0 0 0.1rem;
  border-bottom: 0;
  margin-bottom: 0;
}

.mobile-menu-title {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.58);
  text-align: center;
}

.mobile-menu-link {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  text-align: center;
  padding: 0.82rem 0.8rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.mobile-menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.mobile-menu-link.is-active {
  background:
    radial-gradient(180px 80px at 10% 10%, rgba(23, 111, 102, 0.3), transparent 60%),
    rgba(255, 255, 255, 0.08);
  border-color: rgba(23, 111, 102, 0.4);
  box-shadow: inset 0 0 0 1px rgba(23, 111, 102, 0.14);
}

.topbar-links {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--white);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main {
  padding: 2rem 0 3rem;
  display: grid;
  gap: 1.4rem;
}

.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

#files-panel .panel-head {
  align-items: center;
}

#files-panel .panel-head h2 {
  line-height: 1;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.45rem;
}

.panel-head p {
  margin: 0.35rem 0 0;
  color: var(--slate);
}

.stack {
  display: grid;
  gap: 1rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.38rem;
}

.field label,
.field-title {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}

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

input[type="email"],
input[type="password"],
input[type="search"],
input[type="text"],
input[type="file"],
textarea,
select {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 22, 32, 0.12);
  background: var(--fog);
  padding: 0.8rem 0.9rem;
  color: var(--ink);
}

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

.actions,
.inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.15rem;
  background: var(--ink);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(12, 18, 28, 0.14);
}

.btn.block {
  width: 100%;
  justify-content: center;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn.secondary {
  background: var(--white);
  color: var(--ink);
  border: 1px solid rgba(15, 22, 32, 0.12);
  box-shadow: none;
}

.btn.warn {
  background: var(--danger);
}

.notice {
  border-radius: var(--radius-md);
  padding: 0.95rem 1rem;
  background: #f7fbfa;
  border: 1px solid rgba(23, 111, 102, 0.16);
  color: var(--ink-soft);
}

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

.status {
  min-height: 1.25rem;
  color: var(--slate);
  font-size: 0.94rem;
}

.status.error { color: var(--danger); }
.status.success { color: var(--teal); }

.upload-mode-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: var(--radius-pill);
  background: #e9ecef;
  border: 1px solid rgba(15, 22, 32, 0.08);
  width: min(440px, 100%);
}

.upload-mode-btn {
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0.7rem 0.85rem;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.upload-mode-btn.is-active {
  background: #123a33;
  color: var(--white);
  box-shadow: 0 10px 22px rgba(12, 18, 28, 0.14);
}

.upload-results {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
}

.upload-result {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 0.5rem 0.7rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.55rem;
  row-gap: 0.25rem;
  align-items: start;
}

.upload-result-tone {
  border-radius: var(--radius-pill);
  padding: 0.16rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upload-result-tone.uploaded {
  background: rgba(23, 111, 102, 0.14);
  color: var(--teal);
}

.upload-result-tone.failed {
  background: rgba(168, 46, 66, 0.13);
  color: var(--danger);
}

.upload-result-tone.skipped {
  background: rgba(12, 18, 28, 0.1);
  color: var(--ink-soft);
}

.upload-result-name {
  font-weight: 700;
  color: var(--ink);
  word-break: break-word;
}

.upload-result-message {
  grid-column: 2;
  color: var(--slate);
  font-size: 0.88rem;
  word-break: break-word;
}

.hidden { display: none !important; }

.account-summary,
.dashboard-layout {
  display: grid;
  gap: 1rem;
}

.dashboard-layout {
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
}

.section-menu {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: #e9ecef;
  border: 1px solid rgba(15, 22, 32, 0.08);
  width: min(420px, 100%);
}

.section-menu-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.section-menu-btn.is-active {
  background: #123a33;
  color: var(--white);
  box-shadow: 0 10px 22px rgba(12, 18, 28, 0.14);
}

.section-view {
  display: grid;
  gap: 1rem;
}

.section-view#library-section {
  gap: 0.45rem;
}

.section-view[hidden] {
  display: none !important;
}

.dashboard-sidebar,
.dashboard-main {
  display: grid;
  gap: 1rem;
}

.account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffefb 0%, #f8fafc 100%);
  padding: clamp(1.1rem, 2.4vw, 1.5rem);
  display: grid;
  gap: 1rem;
  box-shadow: 0 22px 50px rgba(12, 18, 28, 0.08);
}

.account-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.account-top h3 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.65rem, 2.6vw, 2rem);
  min-width: 0;
}

.profile-settings-button {
  padding-inline: 1.3rem;
  justify-self: end;
  white-space: nowrap;
}

.account-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.account-item {
  display: grid;
  gap: 0.2rem;
}

.account-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}

.account-value {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
}

.account-note {
  margin: 0;
  color: var(--slate);
  font-size: 0.94rem;
}

.current-plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(23, 111, 102, 0.16);
  background:
    radial-gradient(240px 120px at 8% 12%, rgba(23, 111, 102, 0.06), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
}

.current-plan-name,
.current-plan-copy {
  margin: 0;
}

.current-plan-name {
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 800;
  color: var(--ink);
}

.current-plan-copy {
  margin-top: 0.25rem;
  color: var(--slate);
}

.current-plan-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-toggle {
  width: 100%;
  border: 1px solid rgba(15, 22, 32, 0.1);
  border-radius: 18px;
  background:
    radial-gradient(220px 110px at 94% 14%, rgba(234, 155, 63, 0.1), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
  padding: 1rem 1.05rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
  cursor: pointer;
}

.section-toggle h3,
.section-toggle p {
  margin: 0;
}

.section-toggle p {
  margin-top: 0.22rem;
  color: var(--slate);
}

.section-toggle-indicator {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(15, 22, 32, 0.1);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
}

.section-toggle.is-open .section-toggle-indicator {
  font-size: 1.4rem;
}

.embed-access-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid rgba(234, 155, 63, 0.2);
  background:
    radial-gradient(220px 110px at 92% 14%, rgba(234, 155, 63, 0.12), transparent 60%),
    linear-gradient(180deg, #fffefb 0%, #f9fafc 100%);
}

.embed-access-title,
.embed-access-copy {
  margin: 0;
}

.embed-access-title {
  font-weight: 800;
  color: var(--ink);
}

.embed-access-copy {
  margin-top: 0.22rem;
  color: var(--slate);
}

.billing-plan-picker {
  display: grid;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.plan-card {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(15, 22, 32, 0.1);
  background: #ffffff;
}

.plan-card.is-current {
  border-color: rgba(23, 111, 102, 0.26);
  box-shadow: 0 18px 34px rgba(23, 111, 102, 0.08);
  background:
    radial-gradient(220px 120px at 12% 10%, rgba(23, 111, 102, 0.06), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfa 100%);
}

.plan-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.plan-name,
.plan-price,
.plan-summary,
.plan-limit,
.plan-footnote {
  margin: 0;
}

.plan-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
}

.plan-price {
  color: var(--teal);
  font-weight: 700;
}

.plan-summary {
  color: var(--slate);
  font-size: 0.94rem;
}

.plan-limit {
  font-weight: 700;
  color: var(--ink-soft);
}

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

.setting-toggles {
  align-items: stretch;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(15, 22, 32, 0.1);
  background: var(--fog);
  cursor: pointer;
  font-weight: 700;
}

.toggle-pill input {
  width: auto;
  margin: 0;
}

.table-shell {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

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

.data-table th,
.data-table td {
  padding: 0.85rem 0.95rem;
  text-align: left;
  border-bottom: 1px solid rgba(15, 22, 32, 0.08);
  vertical-align: middle;
}

.data-table th {
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
}

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

.is-selected-row {
  background: rgba(23, 111, 102, 0.06);
}

.admin-topbar-button {
  display: inline-flex;
}

.plan-badge {
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.7rem;
  background: #123a33;
  color: var(--white);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-features {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--slate);
  display: grid;
  gap: 0.35rem;
}

.plan-footnote {
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.billing-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 180px auto;
  gap: 0.8rem;
  align-items: end;
}

.doc-list,
.download-list {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.doc-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: grid;
  gap: 0.75rem;
  background: #fff;
}

.doc-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.doc-subtitle,
.doc-snippet,
.doc-error {
  margin: 0;
  color: var(--slate);
  font-size: 0.94rem;
}

.doc-error { color: var(--danger); }

.doc-status {
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  background: var(--fog);
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: capitalize;
}

.doc-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.download-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.42rem 0.58rem;
  min-height: 0;
}

.file-row {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.file-row:hover {
  transform: translateY(-1px);
  border-color: rgba(23, 111, 102, 0.22);
  box-shadow: 0 16px 28px rgba(12, 18, 28, 0.07);
}

.file-row:focus-visible {
  outline: 2px solid rgba(23, 111, 102, 0.4);
  outline-offset: 2px;
}

.file-row-main {
  min-width: 0;
}

.file-row-actions {
  justify-self: end;
  align-items: center;
}

.file-row-controls {
  position: relative;
  justify-self: end;
  display: flex;
  align-items: center;
}

.file-row-menu-toggle {
  display: none;
}

.file-row-actions .btn {
  padding: 0.4rem 0.62rem;
  box-shadow: none;
  font-size: 0.84rem;
}

.btn-delete-solid {
  border-color: #a82e42;
  background: #a82e42;
  color: #ffffff;
}

.btn-delete-solid:hover,
.btn-delete-solid:focus-visible {
  border-color: #92283a;
  background: #92283a;
  color: #ffffff;
}

.danger-zone {
  margin-top: 1.15rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(15, 22, 32, 0.08);
  display: grid;
  gap: 0.9rem;
}

.danger-zone-kicker {
  margin: 0 0 0.22rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #a82e42;
}

.danger-zone-text {
  margin: 0;
  color: var(--slate);
}

.download-name {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-size: 0.98rem;
}

.download-meta {
  margin: 0.08rem 0 0;
  color: var(--slate);
  font-size: 0.86rem;
  line-height: 1.1;
}

.empty {
  margin: 0;
  color: var(--slate);
}

code.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--fog);
  padding: 0.14rem 0.35rem;
  border-radius: 6px;
}

.auth-panel {
  padding: clamp(1.2rem, 2.5vw, 1.8rem);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 0.85fr);
  gap: 1.15rem;
  align-items: stretch;
}

.auth-intro {
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  color: var(--white);
  background:
    radial-gradient(500px 240px at 15% 18%, rgba(23, 111, 102, 0.36), transparent 58%),
    radial-gradient(360px 220px at 88% 14%, rgba(234, 155, 63, 0.28), transparent 55%),
    linear-gradient(145deg, #0f1721 0%, #152131 52%, #101a26 100%);
  display: grid;
  gap: 1.2rem;
  min-height: 100%;
}

.auth-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.auth-intro h2 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  line-height: 1.05;
}

.auth-intro p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  max-width: 34ch;
}

.auth-points {
  display: grid;
  gap: 0.75rem;
  margin-top: auto;
}

.auth-point {
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  padding: 0.9rem 1rem;
}

.auth-point-title {
  margin: 0 0 0.15rem;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 700;
}

.auth-point-copy {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.96rem;
}

.auth-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 18px 42px rgba(12, 18, 28, 0.08);
  padding: clamp(1.25rem, 2.2vw, 1.7rem);
  display: grid;
  gap: 1rem;
  align-content: start;
}

.auth-card-head {
  display: grid;
  gap: 0.35rem;
}

.auth-card-head h3 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.55rem;
}

.auth-card-head p {
  margin: 0;
  color: var(--slate);
}

.auth-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: #e9ecef;
  border: 1px solid rgba(15, 22, 32, 0.08);
}

.auth-toggle-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1rem;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.auth-toggle-btn.is-active {
  background: #123a33;
  color: var(--white);
  box-shadow: 0 10px 22px rgba(12, 18, 28, 0.14);
}

.auth-form {
  display: grid;
  gap: 1rem;
}

.route-status {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 120px);
}

.route-card {
  width: min(520px, calc(100vw - 2rem));
  text-align: center;
}

.embed-body {
  min-height: auto;
  background:
    radial-gradient(760px 360px at 8% 10%, rgba(23, 111, 102, 0.1), transparent 58%),
    linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
}

.embed-shell {
  width: min(1120px, calc(100vw - 1.4rem));
  margin: 0 auto;
  padding: 0.7rem 0;
}

.embed-head h1 {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
}

.embed-records-list {
  display: grid;
  gap: 0.75rem;
}

.embed-record-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.8rem;
}

.embed-record-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.embed-record-main {
  display: grid;
  gap: 0.7rem;
}

.embed-record-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.file-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 14, 20, 0.72);
  padding: 1.2rem;
  z-index: 40;
}

.file-modal.is-open {
  display: flex;
}

.file-modal-dialog {
  width: min(1080px, 96vw);
  max-height: 90vh;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 26px 70px rgba(12, 18, 28, 0.28);
  border: 1px solid rgba(15, 22, 32, 0.12);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}

.file-modal-header {
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #0f141b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.file-modal-title {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.1rem;
  color: #ffffff;
}

.file-modal-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.file-modal-link,
.file-modal-close {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  padding: 0.38rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.file-modal-danger {
  border-color: rgba(168, 46, 66, 0.72);
  background: rgba(168, 46, 66, 0.18);
}

.file-modal-body {
  min-height: 60vh;
  background: #ffffff;
}

.file-modal-frame {
  width: 100%;
  height: 72vh;
  border: 0;
  display: block;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 14, 20, 0.64);
  padding: 1.2rem;
  z-index: 60;
}

.confirm-modal.is-open {
  display: flex;
}

.confirm-modal-dialog {
  width: min(460px, 96vw);
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(15, 22, 32, 0.12);
  box-shadow: 0 26px 70px rgba(12, 18, 28, 0.24);
  overflow: hidden;
}

.confirm-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.1rem 0.85rem;
  border-bottom: 1px solid rgba(15, 22, 32, 0.08);
  background:
    radial-gradient(240px 130px at 10% 12%, rgba(168, 46, 66, 0.08), transparent 60%),
    linear-gradient(180deg, #fffefb 0%, #f8fafc 100%);
}

.confirm-modal-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #a82e42;
}

.confirm-modal-title {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.45rem;
  line-height: 1.05;
}

.confirm-modal-body {
  padding: 1rem 1.1rem 1.15rem;
  display: grid;
  gap: 1rem;
}

.confirm-modal-copy {
  margin: 0;
  color: var(--slate);
  line-height: 1.55;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.settings-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(9, 14, 20, 0.64);
  padding: 1.2rem;
  z-index: 50;
}

.settings-modal.is-open {
  display: flex;
}

.settings-modal-dialog {
  width: min(560px, 96vw);
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid rgba(15, 22, 32, 0.12);
  box-shadow: 0 26px 70px rgba(12, 18, 28, 0.24);
  overflow: hidden;
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.15rem 0.9rem;
  border-bottom: 1px solid rgba(15, 22, 32, 0.08);
  background:
    radial-gradient(260px 140px at 10% 12%, rgba(23, 111, 102, 0.08), transparent 60%),
    linear-gradient(180deg, #fffefb 0%, #f6f9fc 100%);
}

.settings-modal-kicker {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}

.settings-modal-title {
  margin: 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.5rem;
}

.settings-modal-close {
  border: 1px solid rgba(15, 22, 32, 0.12);
  border-radius: var(--radius-pill);
  padding: 0.65rem 1rem;
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}

.settings-modal-body {
  padding: 1.1rem 1.15rem 1.2rem;
}

#embed-code {
  min-height: 140px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.library-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
}

.library-action-slot .btn,
.library-action-slot .button-link {
  width: 100%;
}

@media (max-width: 860px) {
  .grid-3,
  .search-row,
  .account-list,
  .auth-layout,
  .plan-grid,
  .billing-meta-grid,
  .current-plan-card,
  .embed-access-card {
    grid-template-columns: 1fr;
  }

  .auth-intro p {
    max-width: none;
  }

  .file-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .file-row-controls {
    align-items: flex-start;
    flex-direction: row-reverse;
    gap: 0.35rem;
  }

  .file-row-menu-toggle {
    display: inline-flex;
    padding: 0.42rem 0.7rem;
    font-size: 0.82rem;
    box-shadow: none;
  }

  .file-row-actions {
    display: none;
    position: static;
    min-width: 0;
    max-width: min(58vw, 22rem);
    justify-content: flex-end;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .file-row-controls.is-open .file-row-actions {
    display: flex;
  }

  .file-row-actions .btn {
    width: auto;
    justify-content: center;
    padding: 0.42rem 0.58rem;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .file-row-main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .file-row.is-actions-open .file-row-main {
    display: none;
  }

  .current-plan-actions {
    justify-content: flex-start;
  }

  .download-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .download-meta {
    display: none;
  }
}

@media (max-width: 640px) {
  .login-topbar-row .brand-badge-image {
    width: min(62vw, 220px);
  }

  .topbar-inner,
  .main {
    width: min(100vw - 1.2rem, 1120px);
  }

  .topbar-inner {
    padding: 1rem 0 1.35rem;
  }

  .topbar-row {
    text-align: left;
  }

  .topbar-links {
    justify-content: center;
  }

  .dashboard-topbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 42px;
    align-items: center;
    gap: 0.75rem;
  }

  .mobile-menu.is-open {
    padding-top: 0.8rem;
  }

  .dashboard-topbar-row .brand {
    min-width: 0;
    justify-self: start;
  }

  .dashboard-topbar-row .brand-badge {
    flex: 0 0 auto;
  }

  .dashboard-topbar-row .brand-badge-image {
    height: 24px;
    max-width: min(58vw, 220px);
  }

  .topbar-logout {
    display: inline-flex;
    justify-self: center;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .profile-settings-button {
    width: auto;
  }

  .library-actions-grid {
    gap: 0.65rem;
  }

  .library-action-slot .btn {
    padding: 0.68rem 0.7rem;
    font-size: 0.94rem;
  }

  .panel {
    padding: 1.1rem;
  }

  .auth-panel {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .auth-intro,
  .auth-card {
    border-radius: 20px;
  }

  .auth-intro {
    padding: 1.15rem 1.1rem;
    gap: 0.85rem;
    text-align: center;
    justify-items: center;
  }

  .auth-intro h2 {
    font-size: 1.55rem;
  }

  .auth-intro > .stack {
    gap: 0.55rem;
    justify-items: center;
  }

  .auth-intro > .stack p:last-child,
  .auth-points {
    display: none;
  }

  .auth-toggle {
    border-radius: 18px;
  }

  .auth-toggle-btn,
  .auth-toggle-btn.is-active {
    border-radius: 14px;
  }

  .file-modal-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .file-modal-actions {
    justify-content: center;
  }

  .file-modal-frame {
    height: 68vh;
  }

  .embed-search-row {
    grid-template-columns: 1fr;
  }

  .confirm-modal-header {
    flex-direction: column;
    align-items: stretch;
  }

  .confirm-modal-actions {
    justify-content: stretch;
  }

  .confirm-modal-actions .btn {
    flex: 1 1 0;
  }

}

@media (min-width: 641px) {
  .file-row-controls {
    gap: 0.45rem;
  }

  .dashboard-topbar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.9rem;
  }

  .dashboard-topbar-row .brand {
    min-width: 0;
    justify-self: start;
  }

  .topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-self: end;
  }

  .menu-toggle {
    display: inline-flex;
    justify-self: end;
  }

  .mobile-menu.is-open {
    margin-top: 0.35rem;
  }
}
