:root {
  color-scheme: light;
  --alp-navy: #004C7F;
  --alp-navy-dark: #0A4675;
  --alp-navy-deep: #07375E;
  --alp-royal: #0E63A3;
  --alp-royal-bright: #1E73BE;
  --alp-sky: #2A8FD7;
  --alp-sky-soft: #A9DDF5;
  --alp-teal: #00B6C9;
  --alp-teal-hover: #00D4E8;
  --alp-teal-press: #009BAA;
  --alp-teal-dark: #00899A;
  --alp-text: #12324C;
  --alp-heading: #07375E;
  --alp-muted: #526E82;
  --alp-divider: rgba(7, 55, 94, 0.16);
  --alp-bg: #EAF7FF;
  --alp-card: rgba(235, 247, 255, 0.88);
  --alp-card-solid: #EBF7FF;
  --alp-card-soft: rgba(255, 255, 255, 0.58);
  --alp-card-hover: rgba(0, 182, 201, 0.12);
  --alp-shadow: 0 18px 50px rgba(4, 63, 106, 0.18);
  --alp-soft-shadow: 0 10px 30px rgba(4, 63, 106, 0.13);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  background: var(--alp-bg);
  color: var(--alp-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

:root[data-theme="light"] {
  color-scheme: light;
  --alp-text: #1A2A3A;
  --alp-heading: #133E5D;
  --alp-muted: #647386;
  --alp-divider: #DDE7EF;
  --alp-bg: #F4F8FB;
  --alp-card: #FFFFFF;
  --alp-card-solid: #FFFFFF;
  --alp-card-soft: #EEF3F8;
  --alp-card-hover: rgba(0, 182, 201, 0.07);
  --alp-shadow: 0 14px 42px rgba(0, 76, 127, 0.13);
  --alp-soft-shadow: 0 8px 26px rgba(0, 76, 127, 0.09);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 86% 4%, rgba(255, 255, 255, 0.68), transparent 24rem),
    radial-gradient(circle at 12% 16%, rgba(0, 212, 232, 0.28), transparent 28rem),
    linear-gradient(135deg, #0E63A3 0%, #2A8FD7 48%, #A9DDF5 100%);
}

html[data-theme="light"] {
  background:
    radial-gradient(circle at 82% 0%, rgba(0, 182, 201, 0.16), transparent 34rem),
    linear-gradient(180deg, #F8FBFD 0%, #EEF5FA 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.04) 24rem),
    transparent;
  color: var(--alp-text);
}

a {
  color: #006E9A;
  text-decoration: none;
}

a:hover {
  color: var(--alp-teal-dark);
  text-decoration: underline;
}

html[data-theme="light"] a {
  color: var(--alp-teal-dark);
}

html[data-theme="light"] a:hover {
  color: var(--alp-teal);
}

.banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background:
    linear-gradient(135deg, rgba(0, 76, 127, 0.96) 0%, rgba(30, 115, 190, 0.96) 100%);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 12px 34px rgba(4, 63, 106, 0.24);
  backdrop-filter: blur(14px);
  padding: 16px 0;
}

.banner-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand:hover {
  color: #fff;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 40px;
  width: auto;
  max-width: min(190px, 50vw);
}

.brand-tag {
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.20);
  white-space: nowrap;
}

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

.action,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.30);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 680;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.theme-toggle {
  gap: 8px;
  min-width: 132px;
  border-radius: 999px;
  padding: 0 14px 0 8px;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-size: 13px;
}

.theme-toggle::before {
  content: "";
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 35%, #FFFFFF 0 18%, transparent 19%),
    radial-gradient(circle at 50% 50%, #FFE795 0 45%, #FFC84A 46% 100%);
  box-shadow: 0 0 0 4px rgba(255, 232, 120, 0.16);
}

html[data-theme="light"] .theme-toggle::before {
  background:
    radial-gradient(circle at 68% 32%, rgba(244, 248, 251, 0.92) 0 25%, transparent 26%),
    linear-gradient(135deg, #0E63A3, #004C7F);
  box-shadow: 0 0 0 4px rgba(0, 76, 127, 0.15);
}

.action:hover,
.theme-toggle:hover {
  border-color: var(--alp-teal);
  background: rgba(0, 182, 201, 0.18);
  color: #fff;
  text-decoration: none;
}

.actions .action,
.actions .action:visited,
.actions .theme-toggle,
html[data-theme="light"] .actions .action,
html[data-theme="light"] .actions .action:visited,
html[data-theme="light"] .actions .theme-toggle {
  color: #FFFFFF;
}

.actions .action:hover,
html[data-theme="light"] .actions .action:hover {
  color: #FFFFFF;
}

.action.primary {
  border-color: var(--alp-teal);
  background: var(--alp-teal);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 182, 201, 0.24);
}

.action.primary:hover,
.button.primary:hover,
button.primary:hover {
  background: var(--alp-teal-hover);
  border-color: var(--alp-teal-hover);
  box-shadow: 0 6px 18px rgba(0, 182, 201, 0.35);
  transform: translateY(-1px);
}

main,
.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 18px 58px;
}

h1,
h2,
h3 {
  color: var(--alp-heading);
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  margin: 0 0 8px;
  font-weight: 780;
}

h2 {
  font-size: 19px;
  line-height: 1.22;
  margin: 0 0 12px;
  font-weight: 740;
}

p {
  line-height: 1.6;
}

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

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--alp-divider);
  border-radius: 8px;
  background: var(--alp-card-soft);
  color: var(--alp-text);
  font: inherit;
  font-weight: 680;
  text-decoration: none;
  cursor: pointer;
}

button.primary,
.button.primary {
  border-color: var(--alp-teal);
  background: var(--alp-teal);
  color: #fff;
}

button:hover,
.button:hover {
  border-color: var(--alp-teal);
  text-decoration: none;
}

section,
form.panel,
.listing,
.portal-card,
.manager-frame-wrap {
  background: var(--alp-card);
  border: 1px solid var(--alp-divider);
  border-radius: 12px;
  box-shadow: var(--alp-soft-shadow);
  backdrop-filter: blur(14px);
}

section,
form.panel {
  padding: 18px;
  margin-top: 16px;
}

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

label {
  display: block;
  font-weight: 680;
  margin: 14px 0 8px;
}

label:first-child {
  margin-top: 0;
}

input,
select,
textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--alp-divider);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--alp-text);
  font: inherit;
}

html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea {
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(0, 182, 201, 0.25);
  border-color: var(--alp-teal);
}

textarea {
  min-height: 62px;
  resize: vertical;
  overflow-wrap: anywhere;
}

code,
pre {
  background: var(--alp-card-soft);
  border-radius: 8px;
}

pre {
  overflow: auto;
  padding: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

th,
td {
  border-bottom: 1px solid var(--alp-divider);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

th {
  color: var(--alp-heading);
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--alp-card-soft);
}

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

tbody tr:hover {
  background: var(--alp-card-hover);
}

.listing {
  overflow-x: auto;
}

.listing table {
  min-width: 820px;
}

.name {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  color: var(--alp-text);
  font-weight: 680;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.name:hover {
  color: var(--alp-teal-hover);
}

html[data-theme="light"] .name:hover {
  color: var(--alp-teal-dark);
}

.label {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--alp-teal);
}

.icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.icon.file {
  color: var(--alp-muted);
}

.col-tools {
  width: 180px;
}

.download-tools {
  position: relative;
}

.download-tools summary {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(0, 182, 201, 0.32);
  border-radius: 999px;
  background: rgba(235, 247, 255, 0.86);
  color: #064E74;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.download-tools[open] summary {
  border-color: var(--alp-teal);
}

.download-tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-width: 210px;
}

.download-tool-buttons button,
.download-tool-link {
  min-height: 30px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  color: #064E74;
}

.download-tool-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 182, 201, 0.32);
  background: rgba(255, 255, 255, 0.72);
  font-weight: 680;
  text-decoration: none;
}

.download-tool-link:hover {
  border-color: var(--alp-teal);
  background: rgba(0, 182, 201, 0.12);
  color: #064E74;
  text-decoration: none;
}

.col-size {
  width: 130px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.col-mod {
  width: 190px;
  color: var(--alp-muted);
  white-space: nowrap;
}

.muted {
  color: var(--alp-muted);
  font-size: 14px;
}

.empty {
  padding: 26px;
  color: var(--alp-muted);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--alp-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.crumbs a {
  color: inherit;
}

.crumbs .sep {
  opacity: 0.58;
}

.summary,
.manager-actions,
.picker-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.inline-form button {
  min-height: 34px;
}

.summary {
  margin: 0 0 14px;
  color: var(--alp-muted);
  font-size: 13px;
}

.summary span,
.account-chip,
.role-chip {
  border: 1px solid rgba(0, 182, 201, 0.30);
  border-radius: 999px;
  background: rgba(235, 247, 255, 0.72);
  color: var(--alp-text);
}

.summary span {
  padding: 5px 11px;
  font-weight: 580;
}

.summary .accent,
.account-chip {
  color: #075C83;
}

html[data-theme="light"] .summary .accent,
html[data-theme="light"] .account-chip {
  color: var(--alp-teal-dark);
}

.account-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 740;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.role-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: #075C83;
  font-size: 13px;
  font-weight: 760;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.portal-card {
  display: block;
  min-height: 116px;
  padding: 18px;
  color: var(--alp-text);
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.portal-card:hover {
  border-color: var(--alp-teal);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--alp-shadow);
}

.portal-card strong {
  display: block;
  color: var(--alp-heading);
  font-size: 17px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.portal-card span {
  display: block;
  color: var(--alp-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.admin-panel {
  border-color: rgba(0, 182, 201, 0.35);
  background: rgba(214, 245, 252, 0.72);
}

.account-actions {
  margin-top: 14px;
}

.manager-shell {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.workspace-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(7, 55, 94, 0.14);
  border-radius: 12px;
  background: rgba(235, 247, 255, 0.72);
  box-shadow: 0 8px 24px rgba(4, 63, 106, 0.10);
  backdrop-filter: blur(14px);
}

.manager-frame-wrap {
  height: min(82vh, 980px);
  min-height: 680px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #F7FCFF 0%, #EAF7FF 100%);
  box-shadow: 0 18px 50px rgba(4, 63, 106, 0.18);
}

.manager-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #F7FCFF;
}

.copy-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(130px, 180px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.copy-row label {
  margin: 0;
}

.copy-value {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
}

.copy-note {
  margin: 8px 0 0;
}

.copy-status {
  min-height: 20px;
  margin-top: 10px;
  font-size: 14px;
  font-weight: 740;
  color: #006E9A;
}

.upload-drop {
  border-style: dashed;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.upload-drop.drag-over {
  border-color: var(--alp-teal);
  background: rgba(0, 182, 201, 0.14);
  transform: translateY(-1px);
}

.upload-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.transfer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.stat-card,
.metric-chip,
.stream-row {
  border: 1px solid var(--alp-divider);
  border-radius: 12px;
  background: rgba(235, 247, 255, 0.82);
  box-shadow: var(--alp-soft-shadow);
}

.stat-card {
  min-height: 86px;
  padding: 14px;
}

.stat-card span,
.metric-chip small {
  display: block;
  color: var(--alp-muted);
  font-size: 12px;
  font-weight: 740;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  color: var(--alp-heading);
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.transfer-cockpit {
  overflow: hidden;
}

.transfer-actions {
  margin-top: 12px;
}

.wide-progress {
  width: 100%;
  height: 14px;
  margin-top: 14px;
  accent-color: var(--alp-teal);
}

.transfer-list {
  margin-top: 16px;
}

.upload-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--alp-divider);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.48);
}

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

.upload-row strong,
.transfer-row-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.upload-row progress {
  width: 100%;
  height: 12px;
  accent-color: var(--alp-teal);
}

.upload-state {
  grid-column: 1 / -1;
  color: var(--alp-muted);
  font-size: 13px;
}

.transfer-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.metric-chip {
  padding: 10px;
  box-shadow: none;
}

.metric-chip strong {
  display: block;
  margin-top: 3px;
  color: var(--alp-text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.transfer-result {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.stream-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.stream-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) repeat(4, minmax(90px, auto));
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
}

.stream-row strong {
  overflow-wrap: anywhere;
}

.error {
  border-color: #F87171;
  background: rgba(127, 29, 29, 0.52);
  color: #FEE2E2;
}

html[data-theme="light"] .error {
  background: #FFF1F2;
  color: #991B1B;
}

.success {
  border-color: var(--alp-teal);
  background: rgba(0, 182, 201, 0.10);
}

.nowrap {
  white-space: nowrap;
}

footer {
  padding: 22px 18px 30px;
  color: var(--alp-muted);
  text-align: center;
  font-size: 13px;
}

footer .tag {
  color: #FFFFFF;
  font-weight: 740;
}

html[data-theme="light"] footer .tag {
  color: var(--alp-teal-dark);
}

@media (max-width: 780px) {
  .banner-inner,
  .topbar,
  .grid {
    display: block;
  }

  .brand {
    margin-bottom: 14px;
  }

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

  .action,
  .theme-toggle {
    flex: 1 1 auto;
  }

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

  .manager-frame-wrap {
    min-height: 72vh;
    height: 72vh;
    border-radius: 12px;
  }

  .col-mod {
    width: auto;
    white-space: normal;
  }

  .col-tools {
    width: auto;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

::selection {
  background: rgba(0, 182, 201, 0.25);
  color: inherit;
}

::-moz-selection {
  background: rgba(0, 182, 201, 0.25);
  color: inherit;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 182, 201, 0.32);
  border-radius: 3px;
}
