/* VaultDrop styles. No inline styles anywhere: the CSP blocks them. */

:root {
  color-scheme: dark light;
  --bg: #0B0B0D;
  --surface: #1E1E21;
  --raised: #28282B;
  --border: #3A3A3E;
  --text: #F5F5F5;
  --text-2: #9A9AA0;
  --text-3: #6E6E74;
  --accent: #2FA6D6;
  --accent-strong: #00779E;
  --on-strong: #FFFFFF;
  --ok: #10B981;
  --ok-bg: #1B302C;
  --warn: #E8A600;
  --bad: #FF5A5A;
  --bad-bg: #3A1D1D;
  --focus: #5CC4F0;
  --radius: 12px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #F4F4F6;
    --surface: #FFFFFF;
    --raised: #ECECF0;
    --border: #CFCFD6;
    --text: #151518;
    --text-2: #55555C;
    --text-3: #77777E;
    --accent: #00698C;
    --accent-strong: #00779E;
    --ok: #0B7A55;
    --ok-bg: #DDF3EA;
    --warn: #8A6200;
    --bad: #C42626;
    --bad-bg: #FBE4E4;
    --focus: #00698C;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

h1, h2 { margin: 0; font-weight: 600; }
h1 { font-size: 20px; }
h2 { font-size: 15px; }
p { margin: 0; }

/* Header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-icon { border-radius: 8px; display: block; }

.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 7px;
  cursor: pointer;
}
.tab.is-active { background: var(--raised); color: var(--text); }

main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.view > * + * { margin-top: 14px; }

/* Drop zone */
.drop {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 30px 16px;
  text-align: center;
}
.drop.is-over { border-color: var(--accent); background: var(--raised); }
.drop-title { font-size: 16px; font-weight: 600; }
.drop-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.drop-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Buttons */
.btn {
  appearance: none;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 16px;
  min-height: 40px;
  cursor: pointer;
}
.btn:hover:not(:disabled) { border-color: var(--text-3); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-strong); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.link {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  padding: 6px 4px;
  cursor: pointer;
}
.link:hover { text-decoration: underline; }

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

/* Queue */
.queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-2);
  font-size: 13px;
}
.queue, .result-list, .activity-list { list-style: none; margin: 0; padding: 0; }
.queue > li, .result-list > li, .activity-list > li {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.queue > li + li, .result-list > li + li, .activity-list > li + li { margin-top: 8px; }

.row-main { flex: 1; min-width: 0; }
.row-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.row-meta { color: var(--text-2); font-size: 12.5px; }
.row-meta.bad { color: var(--bad); }
.row-meta.ok { color: var(--ok); }
.badge {
  font-size: 11px;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  margin-right: 6px;
}
.row-hint { color: var(--text-2); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }

.x {
  appearance: none;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}
.x:hover { color: var(--text); background: var(--raised); }

/* Card + fields */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.field-label { display: block; font-size: 13px; color: var(--text-2); margin: 14px 0 6px; }
.card > .field-label:first-child { margin-top: 0; }
.optional { color: var(--text-3); margin-left: 6px; }

.input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  min-height: 42px;
}
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }

/* Masked text field. A plain text input, so password managers do not offer to save it. */
.secret { -webkit-text-security: disc; text-security: disc; }
.secret.is-revealed { -webkit-text-security: none; text-security: none; }

.pass-row { display: flex; gap: 8px; align-items: stretch; }
.pass-row .input { flex: 1; min-width: 0; }

.meter { margin-top: 10px; }
.meter-track { height: 6px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.meter-fill { height: 100%; width: 0; background: var(--bad); border-radius: 3px; transition: width 0.15s ease; }
.meter-text { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); margin-top: 4px; }
.lvl-0 { background: var(--bad); }
.lvl-1 { background: #E67E22; }
.lvl-2 { background: #D9B310; }
.lvl-3 { background: #2E9E6B; }
.lvl-4 { background: #2FA6D6; }

.msg { font-size: 12.5px; margin-top: 6px; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }
.note { font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.note.center { text-align: center; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .primary { flex: 1; min-width: 160px; }

/* Results */
.results, .activity { margin-top: 22px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.results-tools { display: flex; align-items: center; gap: 8px; }
.result-list .btn { flex: none; }

/* Footer */
.foot {
  text-align: center;
  color: var(--text-3);
  font-size: 12.5px;
  padding: 16px 16px 24px;
}
.foot p + p { margin-top: 2px; }

/* Update notice. High z-index so nothing sits on top of it. */
.update {
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.update-actions { display: flex; gap: 8px; }

@media (max-width: 520px) {
  .top { padding-top: 16px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .btn.small { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .meter-fill { transition: none; }
}
