/* DROP layout. Colours and fonts are personality.css's; zui.css (loaded between) brings the shared plumbing. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}
body {
  font-size: 14px;
  line-height: 1.5;
  height: 100%;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
@media (min-width: 768px) {
  body { align-items: center; padding: 24px; }
}

.container {
  width: 100%;
  max-width: 560px;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}
@media (min-width: 768px) {
  .container { height: auto; max-height: min(880px, calc(100dvh - 48px)); }
}

.card {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Header ---------- */
.nav-breadcrumbs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.nav-back-link { text-decoration: none; display: inline-flex; align-items: center; min-height: 30px; border-radius: var(--r-pill); }
.nav-back-link:hover { color: var(--text); background: var(--fill); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.btn-theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--border); border-radius: var(--r-pill);
  background: transparent; color: var(--text); cursor: pointer;
}
.btn-theme-toggle svg { width: 15px; height: 15px; }
.tag { text-transform: uppercase; color: var(--text-3); }

.dr-hero { text-align: center; margin-bottom: 18px; }
.dr-brand { display: inline-flex; align-items: center; gap: 10px; }
.dr-logo {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--accent-grad); color: var(--on-accent);
  box-shadow: var(--glow);
}
.dr-logo svg { width: 20px; height: 20px; }
h1 {
  font-family: var(--font-display);
  font-weight: var(--head-weight);
  letter-spacing: var(--head-tracking);
  font-size: 26px;
  line-height: 1;
}
.subtitle { color: var(--text-3); font-size: 13.5px; margin-top: 8px; text-wrap: balance; }

/* ---------- Tabs ---------- */
.dr-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px; margin-bottom: 16px;
  background: var(--fill); border-radius: var(--r-pill);
}
.dr-tabs button {
  font: inherit; font-weight: 600; font-size: 13.5px;
  padding: 9px 0; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--text-3); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.dr-tabs button:hover { color: var(--text-2); }
.dr-tabs button[aria-selected="true"] { background: var(--tab-on); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), filter var(--t-fast), transform var(--t-fast);
}
.btn:hover { border-color: var(--text-4); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: default; transform: none; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.dr-go { width: 100%; min-height: 48px; font-size: 15px; margin-top: 4px; }
.dr-cancel { width: 100%; margin-top: 12px; }
.dr-danger { color: var(--negative); }
.dr-danger:hover { border-color: var(--negative); background: var(--negative-bg); }

/* ---------- Drop zone ---------- */
.dr-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 200px; padding: 28px 18px;
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg);
  background: var(--fill); text-align: center; cursor: pointer;
  transition: border-color var(--t-med), background var(--t-med), transform var(--t-med) var(--ease-out), min-height var(--t-med);
}
.dr-zone:hover, .dr-zone:focus-visible { border-color: var(--accent); outline: none; }
.dr-zone.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.015); }
.dr-zone.has-files { min-height: 96px; padding: 16px; }
.dr-zone.has-files .dr-zone-icon { display: none; }
.dr-zone-icon {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 4px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-text);
}
.dr-zone-icon svg { width: 26px; height: 26px; }
.dr-zone.is-over .dr-zone-icon { animation: drBob 0.9s var(--ease-in-out) infinite; }
.dr-zone-title { font-family: var(--font-display); font-weight: var(--head-weight); font-size: 17px; letter-spacing: var(--head-tracking); }
.dr-zone.has-files .dr-zone-title::before { content: '+ '; }
.dr-zone.has-files .dr-zone-title { font-size: 14px; }
.dr-zone-hint { color: var(--text-3); font-size: 12.5px; }
@keyframes drBob { 50% { transform: translateY(5px); } }

/* ---------- File rows ---------- */
.dr-files { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 12px 0 4px; }
.dr-file {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 10px; min-height: 52px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  animation: drIn var(--t-med) var(--ease-out) both;
}
@keyframes drIn { from { opacity: 0; transform: translateY(4px); } }
.dr-file-ico, .dr-thumb {
  flex: none; width: 38px; height: 38px; border-radius: var(--r-sm);
}
.dr-file-ico {
  display: grid; place-items: center;
  font-family: var(--font-num); font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent-text);
}
.dr-thumb { object-fit: cover; background: var(--fill); }
.dr-file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dr-file-info b { font-weight: 560; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-file-info small { color: var(--text-3); font-size: 12px; }
.dr-x {
  flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer;
}
.dr-x:hover { background: var(--fill-2); color: var(--text); }
.dr-mini { display: block; height: 3px; margin-top: 5px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.dr-mini span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s linear; }
.dr-file.is-done .dr-mini span { background: var(--positive); }
.dr-file.is-failed small { color: var(--negative); }

/* ---------- Options ---------- */
.dr-options { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.dr-opt { display: flex; flex-direction: column; gap: 8px; }
.dr-opt .section-title, .dr-get .section-title { display: block; }
.dr-optional { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-4); }
.dr-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dr-seg button {
  font: inherit; font-size: 13px; font-weight: 560;
  min-height: 40px; border: 1px solid var(--border); border-radius: var(--btn-radius);
  background: transparent; color: var(--text-2); cursor: pointer;
}
.dr-seg button:hover { border-color: var(--border-strong); }
.dr-seg button[aria-checked="true"] { background: var(--solid); color: var(--on-solid); border-color: transparent; }
input:not([type="checkbox"]) { width: 100%; min-height: 44px; padding: 0 14px; font-size: 15px; }
.dr-check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.dr-check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.dr-check span { display: flex; flex-direction: column; }
.dr-check b { font-weight: 560; }
.dr-check small { color: var(--text-3); font-size: 12.5px; }

/* ---------- Progress ---------- */
.dr-progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.dr-progress-head b { font-family: var(--font-display); font-weight: var(--head-weight); font-size: 16px; }
.dr-progress-head span { color: var(--text-3); }
.dr-bar { height: 8px; border-radius: 8px; background: var(--fill-2); overflow: hidden; }
.dr-bar span { display: block; height: 100%; width: 0; background: var(--accent-grad); transition: width 0.25s linear; }

/* ---------- Done ---------- */
.dr-ticket {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 18px 18px;
  border: 1px solid var(--border); border-radius: var(--r-lg);
  background: var(--surface); text-align: center;
  animation: drPop var(--t-slow) var(--ease-spring) both;
}
@keyframes drPop { from { opacity: 0; transform: scale(0.96); } }
.dr-code {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(38px, 12vw, 54px); letter-spacing: 0.12em; line-height: 1.05;
  padding-left: 0.12em; color: var(--accent-text);
  user-select: all;
}
.dr-link { font-family: var(--font-num); font-size: 12.5px; color: var(--text-3); word-break: break-all; }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dr-actions-end { margin-top: 12px; justify-content: space-between; }
.dr-qr { width: 156px; margin-top: 4px; }
.dr-qr svg { display: block; width: 100%; height: auto; border-radius: var(--r-sm); }
.dr-meta { color: var(--text-3); font-size: 12.5px; }

/* ---------- Your drops ---------- */
.dr-mine-title { margin-top: 26px; margin-bottom: 8px; }
.dr-mine { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.dr-mine-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px;
  border: 1px solid var(--border); border-radius: var(--r-md);
}
.dr-mine-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dr-mine-main b { font-family: var(--font-display); font-size: 15px; letter-spacing: 0.08em; }
.dr-mine-names { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-mine-main small { color: var(--text-3); font-size: 12px; }
.dr-mine-acts { display: flex; gap: 6px; flex: none; }

/* ---------- Receive ---------- */
.dr-get { display: flex; flex-direction: column; gap: 10px; }
input.dr-code-input {
  min-height: 68px; text-align: center; text-transform: uppercase;
  font-family: var(--font-display) !important; font-weight: 700; font-size: 32px; letter-spacing: 0.22em;
}
input.dr-code-input::placeholder { color: var(--text-4); opacity: 0.45; }
.dr-hint { color: var(--text-3); font-size: 12.5px; text-align: center; margin-top: -2px; }
#pw-row { display: flex; flex-direction: column; gap: 8px; }
.dr-error { color: var(--negative); background: var(--negative-bg); padding: 9px 12px; border-radius: var(--r-md); font-size: 13px; }
.dr-result-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.dr-result-head .section-title .num { color: var(--text); letter-spacing: 0.1em; }
.dr-result-head .dr-meta { margin-top: 2px; }
.dr-got .dr-file { padding-right: 10px; }

.footer-note { margin-top: auto; padding-top: 28px; text-align: center; font-size: 11.5px; color: var(--text-4); }

.toast-banner {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 100;
  transform: translateX(-50%); max-width: min(92vw, 440px);
  padding: 10px 18px; font-size: 13px; text-align: center; box-shadow: var(--shadow-2);
  transition: opacity var(--t-med), transform var(--t-med) var(--ease-out);
}
/* zui.css animates the toast in with fill-mode both, so hiding it has to take it out entirely */
.toast-banner.hidden { display: none; }

@media (max-width: 420px) {
  .dr-seg { grid-template-columns: repeat(2, 1fr); }
  .dr-result-head { flex-direction: column; align-items: stretch; }
  .dr-mine-item { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
