/* Ferry: harbour fog, deep sea ink, and one amber fuse that shows time left. */

@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/assets/schibsted-grotesk-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url(/assets/schibsted-grotesk-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Dark only: violet night. Near-black with a violet haze, soft cards, violet accents. */
  --fog: #0a0910;
  --paper: #121119;
  --ink: #f1f0f6;
  --ink-soft: #8e8c9e;
  --rule: #24222f;
  --sea: #7c6cf8;
  --sea-deep: #9284ff;
  --sea-tint: rgba(124, 108, 248, 0.14);
  --on-sea: #ffffff;
  --fuse: #8b5cf6;
  --fuse-text: #f5a524;
  --ember: #f26d6d;
  --on-ember: #ffffff;
  --good: #2fd27a;
  --track: #1d1b28;

  --violet-soft: #b4a9ff;
  --card: linear-gradient(180deg, #15141d 0%, #111017 100%);
  --control: #0f0e15;
  --control-line: #2a2838;

  --r-control: 9px;
  --r-panel: 14px;
  --font: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--fog);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
}
h1 {
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}
h2 {
  font-size: 1.125rem;
  font-weight: 700;
}
h3 {
  font-size: 1rem;
  font-weight: 650;
}
p {
  margin: 0;
}
small {
  font-size: 0.8125rem;
}

a {
  color: var(--sea);
  text-underline-offset: 0.18em;
}

:focus-visible {
  outline: 2px solid var(--fuse);
  outline-offset: 2px;
}

/* ---------- Wordmark ---------- */

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .mark {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
  background: var(--sea);
  position: relative;
  flex: none;
}
.wordmark .mark::after {
  content: '';
  position: absolute;
  left: 0.3rem;
  right: 0.55rem;
  bottom: 0.33rem;
  height: 0.2rem;
  border-radius: 99px;
  background: var(--fuse);
}

/* ---------- Form controls ---------- */

label,
legend {
  font-weight: 600;
  font-size: 0.9375rem;
}

input[type='text'],
input[type='password'],
input[type='number'],
input:not([type]),
select,
textarea {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.75rem;
  font: inherit;
  font-weight: 450;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
}
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--sea);
  outline-offset: 0;
  border-color: var(--sea);
}
input::placeholder {
  color: var(--ink-soft);
  opacity: 0.75;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  padding: 0;
  margin-bottom: 0.5rem;
}

.field {
  display: block;
  margin-top: 1.25rem;
}
.opt {
  font-weight: 450;
  color: var(--ink-soft);
}
.hint {
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.form-error {
  color: var(--ember);
  font-size: 0.9rem;
  font-weight: 550;
  margin-top: 0.75rem;
}
.form-error:empty {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  font: inherit;
  font-weight: 650;
  font-size: 0.9375rem;
  line-height: 1.2;
  border-radius: var(--r-control);
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--ink-soft);
}
.btn.primary {
  background: var(--sea);
  border-color: var(--sea);
  color: var(--on-sea);
}
.btn.primary:hover {
  background: var(--sea-deep);
  border-color: var(--sea-deep);
}
.btn.danger {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--on-ember);
}
.btn.small {
  padding: 0.35rem 0.65rem;
  font-size: 0.875rem;
}
.btn.wide {
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.8rem 1rem;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.done {
  border-color: var(--good);
  color: var(--good);
}

.link-btn {
  font: inherit;
  font-weight: 600;
  color: var(--sea);
  background: none;
  border: 0;
  padding: 0.25rem 0.1rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.18em;
}
.link-btn:hover {
  text-decoration-color: currentColor;
}
.link-btn.danger {
  color: var(--ember);
}

/* ---------- The fuse: time left, the one thing that moves ---------- */

.fuse {
  position: relative;
  height: 6px;
  border-radius: 99px;
  background: var(--track);
  overflow: visible;
}
.fuse-burn {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: 99px;
  background: var(--fuse);
  transition: width 0.6s ease;
}
.fuse.low .fuse-burn {
  background: var(--ember);
}
.fuse .spark {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: var(--fuse);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--fuse) 28%, transparent);
  transition: left 0.6s ease;
}
.fuse.low .spark {
  background: var(--ember);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ember) 28%, transparent);
}
.fuse.out .fuse-burn,
.fuse.out .spark {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .fuse.live .spark {
    animation: spark 2.4s ease-in-out infinite;
  }
}
@keyframes spark {
  50% {
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--fuse) 12%, transparent);
  }
}

/* ---------- Sign in and setup ---------- */

.auth {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}
.auth-panel {
  width: 100%;
  max-width: 24rem;
}
.auth-panel .wordmark {
  margin-bottom: 2rem;
}
.auth-panel form {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 1.75rem;
}
.auth-panel h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.auth-panel .lead {
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.auth-panel label {
  display: block;
  margin-top: 1rem;
}
.auth-panel .hint {
  margin-top: 1rem;
}

/* ---------- App frame ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem clamp(1rem, 3vw, 2rem);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.tabs {
  display: flex;
  gap: 0.25rem;
}
.tab {
  font: inherit;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: var(--r-control);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-current='page'] {
  color: var(--ink);
  background: var(--sea-tint);
}
.account {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9375rem;
}
.who {
  font-weight: 650;
}

.page {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem);
}

.layout {
  display: grid;
  grid-template-columns: minmax(20rem, 24rem) 1fr;
  gap: 2rem;
  align-items: start;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 1.5rem;
}

/* ---------- Composer ---------- */

.composer {
  position: sticky;
  top: 1rem;
}
.composer h2 {
  margin-bottom: 1rem;
}

.drop {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  text-align: center;
  padding: 1.75rem 1rem;
  border: 1.5px dashed var(--rule);
  border-radius: var(--r-panel);
  background: var(--fog);
  cursor: pointer;
}
.drop:hover,
.drop.over {
  border-color: var(--sea);
  background: var(--sea-tint);
}
.drop-main {
  font-weight: 700;
  font-size: 1.0625rem;
}
.drop-sub {
  color: var(--ink-soft);
  font-size: 0.875rem;
}

.picked {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 14rem;
  overflow: auto;
}
.picked li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.picked li:last-child {
  border-bottom: 0;
}
.fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
}
.fsize {
  color: var(--ink-soft);
  font-size: 0.875rem;
  white-space: nowrap;
}
.picked-total {
  margin-top: 0.4rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.chip {
  position: relative;
  margin: 0;
}
.chip input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}
.chip span {
  display: block;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  font-weight: 550;
  font-size: 0.875rem;
  background: var(--paper);
  white-space: nowrap;
}
.chip input:checked + span {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.chip input:focus-visible + span {
  outline: 2px solid var(--fuse);
  outline-offset: 2px;
}
.chip input:disabled + span {
  opacity: 0.35;
  text-decoration: line-through;
}

.custom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.custom input,
.custom select {
  margin-top: 0;
}

.expiry-preview {
  margin-top: 1rem;
}
.expiry-note {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.expiry-note strong {
  color: var(--ink);
  font-weight: 650;
}

.choice {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--r-control);
  cursor: pointer;
  font-weight: 450;
}
.choice {
  margin-top: 0;
}
.choice + .choice {
  margin-top: 0.375rem;
}
.choice:has(input:checked) {
  border-color: var(--sea);
  background: var(--sea-tint);
}
.choice input {
  margin: 0.25rem 0 0;
  accent-color: var(--sea);
}
.choice strong {
  display: block;
  font-weight: 650;
}
.choice small {
  color: var(--ink-soft);
}

.code-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.code-row input {
  margin-top: 0;
  font-weight: 650;
  letter-spacing: 0.08em;
}

/* Progress and result inside the composer */

.progress-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.progress-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--rule);
}
.progress-list .row {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.9375rem;
}
.bar {
  height: 4px;
  margin-top: 0.4rem;
  border-radius: 99px;
  background: var(--track);
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--sea);
  border-radius: 99px;
}
.progress-list li.ok .bar > span {
  background: var(--good);
}
.progress-list li.failed .fsize {
  color: var(--ember);
}
.overall {
  font-weight: 650;
  margin-bottom: 0.25rem;
}

.result h2 {
  margin-bottom: 0.25rem;
}
.result .sub {
  color: var(--ink-soft);
  font-size: 0.9375rem;
}
.copy-field {
  margin-top: 1rem;
}
.copy-field > span {
  font-weight: 600;
  font-size: 0.9375rem;
}
.copy-field .row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.copy-field .stack {
  margin-top: 0.35rem;
}
.copy-field .stack .btn {
  margin-top: 0.5rem;
}
.copy-field input,
.copy-field textarea {
  margin-top: 0;
  resize: none;
  font-weight: 550;
}
.result .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.warn {
  margin-top: 1rem;
  padding: 0.65rem 0.8rem;
  border-left: 3px solid var(--ember);
  background: color-mix(in srgb, var(--ember) 9%, var(--paper));
  font-size: 0.9rem;
}

/* ---------- Share list ---------- */

.shares-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
  min-height: 2rem;
}
.shares-head .count {
  color: var(--ink-soft);
  font-weight: 500;
}
.toggle {
  margin-left: auto;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 550;
  font-size: 0.9rem;
  cursor: pointer;
}
.toggle input {
  accent-color: var(--sea);
  margin: 0;
}

.share-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
}
.share {
  display: grid;
  grid-template-columns: 1fr 13rem;
  gap: 0.5rem 2rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.share:last-child {
  border-bottom: 0;
}
.share-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}
.share-title h3 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.tag {
  flex: none;
  font-size: 0.75rem;
  font-weight: 650;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
}
.tag.code {
  border-color: var(--fuse-text);
  color: var(--fuse-text);
}
.share-meta {
  color: var(--ink-soft);
  font-size: 0.875rem;
  margin-top: 0.15rem;
}
.share-time {
  align-self: center;
}
.share-time .left {
  font-variant-numeric: tabular-nums;
  margin-top: 0.4rem;
  font-size: 0.875rem;
  font-weight: 650;
  text-align: right;
}
.share-time .left.low {
  color: var(--ember);
}
.share-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}
.share-actions .btn {
  margin-right: 0.25rem;
}
.share-actions .link-btn.danger {
  margin-left: auto;
}

.share-files {
  grid-column: 1 / -1;
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 0.25rem 0.9rem;
  background: var(--fog);
  border-radius: var(--r-control);
}
.share-files li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.9rem;
}
.share-files li:last-child {
  border-bottom: 0;
}
.share-files .fname a {
  color: inherit;
}
.share-upload {
  grid-column: 1 / -1;
}

.empty {
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
}
.empty h3 {
  margin-bottom: 0.35rem;
}
.empty p {
  color: var(--ink-soft);
  max-width: 28rem;
  margin: 0 auto;
}
.empty .fuse {
  max-width: 10rem;
  margin: 0 auto 1.25rem;
}

/* ---------- People (admin) ---------- */

.people {
  display: grid;
  grid-template-columns: minmax(18rem, 22rem) 1fr;
  gap: 2rem;
  align-items: start;
}
.people form label {
  display: block;
  margin-top: 1rem;
}
.inline {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.inline input {
  margin-top: 0;
}
.people h2 {
  margin-bottom: 0.25rem;
}

.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
  font-size: 0.875rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
td.name {
  font-weight: 650;
}
td.actions {
  text-align: right;
  white-space: nowrap;
}
td .muted,
.muted {
  color: var(--ink-soft);
}
.status-off {
  color: var(--ember);
  font-weight: 600;
}
.usage {
  min-width: 9rem;
}
.usage .bar > span {
  background: var(--ink-soft);
}

/* ---------- Dialogs and toast ---------- */

dialog {
  width: min(30rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  background: var(--paper);
  color: var(--ink);
}
dialog::backdrop {
  background: rgb(5 10 14 / 0.72);
}
dialog form {
  padding: 1.5rem;
}
dialog h2 {
  margin-bottom: 0.5rem;
}
dialog p.sub {
  color: var(--ink-soft);
}
dialog label {
  display: block;
  margin-top: 1rem;
}
dialog .check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 550;
}
dialog .check input {
  margin: 0;
  accent-color: var(--sea);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  padding: 0.65rem 1rem;
  border-radius: var(--r-control);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  font-size: 0.9375rem;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Public share page ---------- */

.public {
  max-width: 40rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 4rem) 1.25rem 4rem;
}
.public > .wordmark {
  font-size: 1.05rem;
  margin-bottom: clamp(2rem, 7vw, 4rem);
}
.public .from {
  color: var(--ink-soft);
  font-weight: 550;
}
.public h1 {
  margin-top: 0.35rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  overflow-wrap: anywhere;
}

.clock {
  margin: 2rem 0 2.25rem;
}
.clock .remaining {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
}
.clock .big {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1;
}
.clock .big.low {
  color: var(--ember);
}
.clock .what {
  color: var(--ink-soft);
  font-weight: 550;
}
.clock .fuse {
  height: 8px;
}
.clock .until {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.unlock {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 1.5rem;
}
.unlock .row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}
.unlock input {
  margin-top: 0;
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: 0.08em;
}
.unlock .hint {
  margin-top: 0.6rem;
}

.files-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.files-head .muted {
  font-weight: 550;
}
.files-head .btn {
  margin-left: auto;
}
.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
}
.file-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.file-list li:last-child {
  border-bottom: 0;
}
.file-list .fname {
  white-space: normal;
  overflow-wrap: anywhere;
}

.gone .fuse {
  margin: 2rem 0;
}
.gone p {
  color: var(--ink-soft);
  margin-top: 0.75rem;
  max-width: 32rem;
}

/* ---------- Small screens ---------- */

@media (max-width: 960px) {
  .layout,
  .people {
    grid-template-columns: 1fr;
  }
  .composer {
    position: static;
  }
}
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }
  .account {
    gap: 0.6rem;
    font-size: 0.875rem;
  }
  .tabs {
    order: 3;
    width: 100%;
  }
  .share {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
  .share-time .left {
    text-align: left;
  }
  .share-actions .link-btn.danger {
    margin-left: 0;
  }
  td,
  th {
    padding: 0.6rem 0.5rem;
  }
}

/* ---------- Invites, admin page, join page ---------- */

.lead {
  color: var(--ink-soft);
}
.from {
  color: var(--ink-soft);
  font-weight: 550;
  margin-bottom: 0.25rem;
}
.block {
  display: block;
}

.narrow {
  max-width: 40rem;
  margin: 0 auto;
  display: grid;
  gap: 1.5rem;
}
.narrow h2 {
  margin-bottom: 0.5rem;
}
.result .copy-field + .hint {
  margin-top: 0.6rem;
}
#invite-result {
  margin-top: 1.25rem;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.plain-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.plain-list li:last-child {
  border-bottom: 0;
}
.grow {
  flex: 1;
  min-width: 0;
}
.grow strong,
.grow small {
  display: block;
}

.code-show {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding: 0.75rem;
  border-radius: var(--r-control);
  background: var(--fog);
  font-size: 0.9375rem;
}
.code-show strong {
  letter-spacing: 0.06em;
}
dialog .code-show .check {
  margin-top: 0.25rem;
}

.unlock label {
  display: block;
  margin-top: 0.85rem;
}
.unlock .lead {
  margin-bottom: 0.25rem;
}
.unlock > .btn {
  margin-top: 1rem;
}

.auth-note {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-panel);
  padding: 1.75rem;
}
.auth-note h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}
.auth-note p + p {
  margin-top: 1.25rem;
}

.admin-tag {
  margin-left: -1.25rem;
  border-color: var(--sea);
  color: var(--sea);
}
.page.admin {
  max-width: 90rem;
  display: grid;
  grid-template-columns: minmax(17rem, 20rem) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
.invite-panel {
  position: sticky;
  top: 1rem;
}
.invite-panel h2 {
  margin-bottom: 0.5rem;
}
.admin-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.panel-head .count {
  color: var(--ink-soft);
  font-weight: 500;
}
td.name a {
  color: inherit;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.stepper .btn.small {
  padding: 0.15rem 0.55rem;
  min-width: 2rem;
}
.stepper .num {
  min-width: 1.25rem;
  text-align: center;
  font-weight: 650;
}

@media (max-width: 960px) {
  .page.admin {
    grid-template-columns: minmax(0, 1fr);
  }
  .invite-panel {
    position: static;
  }
}
@media (max-width: 640px) {
  .admin-tag {
    margin-left: 0;
  }
  .page.admin td,
  .page.admin th {
    white-space: nowrap;
  }
}

/* ---------- User status ---------- */

.status {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 650;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.status.on {
  color: var(--good);
}
.status.off {
  color: var(--ember);
}
.status.admin {
  color: var(--sea);
}
.inline-status {
  margin-left: 0.5rem;
}
.warn-text {
  color: var(--fuse-text);
}
tr.is-off td.name,
tr.is-off td.usage {
  color: var(--ink-soft);
}
.nowrap {
  white-space: nowrap;
}
.action-grid {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 0.1rem 0.9rem;
  justify-items: start;
  text-align: left;
}

/* ---------- Upload, then generate link ---------- */

.step-hint {
  margin-top: 0.75rem;
  text-align: center;
}
.picked.uploaded li::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--good);
  align-self: center;
}
.tag.nolink {
  border-color: var(--fuse-text);
  color: var(--fuse-text);
  border-style: dashed;
}
.share.unlinked .fuse-burn {
  background: var(--ink-soft);
}
dialog .new-link {
  margin-top: 1.25rem;
}
.new-link-note {
  display: block;
  margin-top: 0.2rem;
  padding-left: 1.5rem;
}


/* ================================================================== */
/* Theme: violet night (colours and surfaces only, same layout)        */
/* ================================================================== */

body {
  background-color: var(--fog);
  background-image:
    radial-gradient(1100px 620px at 88% -12%, rgba(112, 82, 255, 0.17), transparent 62%),
    radial-gradient(900px 520px at -10% 110%, rgba(84, 62, 210, 0.1), transparent 60%);
  background-attachment: fixed;
}

:focus-visible {
  outline: 2px solid var(--violet-soft);
  outline-offset: 2px;
}

/* Surfaces */
.panel,
.share-list,
.empty,
.auth-panel form,
.auth-note,
.unlock,
.file-list,
dialog {
  background: var(--card);
  border-color: var(--rule);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 18px 40px -24px rgba(0, 0, 0, 0.8);
}
dialog {
  border-color: #2c2a3c;
  border-radius: 16px;
}
dialog::backdrop {
  background: rgba(5, 4, 10, 0.72);
  backdrop-filter: blur(3px);
}

.topbar {
  background: rgba(13, 12, 19, 0.82);
  border-bottom-color: #1d1b27;
  backdrop-filter: blur(10px);
}

/* Logo mark */
.wordmark .mark {
  border-radius: 7px;
  background: linear-gradient(135deg, #8f7dff 0%, #6a55f2 100%);
  box-shadow: 0 0 14px rgba(124, 108, 248, 0.55);
}
.wordmark .mark::after {
  background: #ffffff;
  opacity: 0.92;
}

/* Tabs */
.tab {
  border: 1px solid transparent;
}
.tab[aria-current='page'] {
  color: #ffffff;
  background: var(--sea-tint);
  border-color: rgba(124, 108, 248, 0.45);
}

/* Form controls */
input[type='text'],
input[type='password'],
input[type='number'],
input:not([type]),
select,
textarea {
  background: var(--control);
  border-color: var(--control-line);
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(124, 108, 248, 0.25);
}
.choice input,
.toggle input,
dialog .check input {
  accent-color: var(--sea);
}

/* Buttons */
.btn {
  background: #17161f;
  border-color: var(--control-line);
}
.btn:hover {
  border-color: #403d57;
  background: #1c1b26;
}
.btn.primary {
  background: linear-gradient(180deg, #8575fb 0%, #6b5af0 100%);
  border-color: #7c6cf8;
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 22px -10px rgba(124, 108, 248, 0.85);
}
.btn.primary:hover {
  background: linear-gradient(180deg, #9384ff 0%, #7563f5 100%);
  border-color: #9284ff;
}
.btn.primary:disabled {
  box-shadow: none;
}
.btn.danger {
  background: #dc3d43;
  border-color: #dc3d43;
  color: #ffffff;
}
.btn.done {
  border-color: var(--good);
  color: var(--good);
}
.link-btn,
a {
  color: var(--violet-soft);
}
.link-btn.danger {
  color: var(--ember);
}

/* Expiry chips: the picked one glows violet */
.chip span {
  background: #15141c;
  border-color: var(--control-line);
}
.chip input:checked + span {
  background: linear-gradient(180deg, #8575fb 0%, #6b5af0 100%);
  border-color: #7c6cf8;
  color: #ffffff;
  box-shadow: 0 6px 16px -8px rgba(124, 108, 248, 0.9);
}

/* Choice cards */
.choice {
  background: rgba(255, 255, 255, 0.012);
}
.choice:has(input:checked) {
  border-color: rgba(124, 108, 248, 0.6);
  background: var(--sea-tint);
}

/* Drop zone */
.drop {
  background: rgba(255, 255, 255, 0.015);
  border-color: #2e2b40;
}
.drop:hover,
.drop.over {
  border-color: var(--sea);
  background: var(--sea-tint);
  box-shadow: inset 0 0 40px rgba(124, 108, 248, 0.12);
}

/* The fuse: a glowing violet line */
.fuse .fuse-burn {
  background: linear-gradient(90deg, #6a55f2 0%, #a58bff 100%);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.55);
}
.fuse.low .fuse-burn {
  background: linear-gradient(90deg, #f59e0b 0%, #f26d6d 100%);
  box-shadow: 0 0 12px rgba(242, 109, 109, 0.5);
}
.share.unlinked .fuse-burn {
  background: #5c5a6e;
  box-shadow: none;
}
.fuse .spark {
  background: #e4dcff;
  box-shadow:
    0 0 0 4px rgba(139, 92, 246, 0.35),
    0 0 16px rgba(165, 139, 255, 0.9);
}
.fuse.low .spark {
  background: #ffd9d9;
  box-shadow:
    0 0 0 4px rgba(242, 109, 109, 0.3),
    0 0 16px rgba(242, 109, 109, 0.8);
}
@keyframes spark {
  50% {
    box-shadow:
      0 0 0 7px rgba(139, 92, 246, 0.14),
      0 0 22px rgba(165, 139, 255, 0.7);
  }
}
.bar {
  background: var(--track);
}
.bar > span {
  background: linear-gradient(90deg, #6a55f2, #a58bff);
}

/* Tags and status pills */
.tag {
  border-color: #2e2c3d;
  background: rgba(255, 255, 255, 0.02);
}
.tag.code {
  border-color: rgba(180, 169, 255, 0.5);
  color: var(--violet-soft);
  background: var(--sea-tint);
}
.tag.nolink {
  border-color: rgba(245, 165, 36, 0.6);
  color: var(--fuse-text);
  background: rgba(245, 165, 36, 0.07);
}
.admin-tag {
  border-color: rgba(124, 108, 248, 0.55);
  color: var(--violet-soft);
  background: var(--sea-tint);
}
.status.on {
  background: rgba(47, 210, 122, 0.08);
}
.status.off {
  background: rgba(242, 109, 109, 0.08);
}
.status.admin {
  color: var(--violet-soft);
  background: var(--sea-tint);
}

/* Lists and tables */
.share-files,
.code-show {
  background: rgba(0, 0, 0, 0.25);
}
th {
  color: var(--ink-soft);
}

/* Notices */
.warn {
  background: rgba(242, 109, 109, 0.08);
}
.toast {
  background: #1b1a26;
  color: var(--ink);
  border: 1px solid rgba(124, 108, 248, 0.45);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.8);
}
