/* ZipShare — palette A: mint + sky (complementary), coral (contrast). Solid surfaces, no blur. */
:root {
  --bg: #f5faf8; --surface: #ffffff; --soft: #eef6f3;
  --ink: #17232e; --muted: #5b6b78; --line: #dfeae6; --line-strong: #c6d8d1;
  --mint: #bdefd9; --mint-deep: #1e9e78; --mint-ink: #0f5c45; --mint-wash: #e6f8f0;
  --sky: #bfe3ff; --sky-deep: #2f7fd1; --sky-ink: #174f8a; --sky-wash: #e9f5ff;
  --coral: #ff8f7a; --coral-deep: #e2664f; --coral-ink: #6e2415; --coral-wash: #fff0ec;
  --rose: #ffe0e3; --rose-ink: #a52a3c; --amber: #ffefc2; --amber-ink: #7a5200;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); --rail: 76px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 "DM Sans", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: "Bricolage Grotesque", "DM Sans", sans-serif; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.mono { font-family: ui-monospace, "SFMono-Regular", monospace; font-size: 0.75rem; word-break: break-all; }
:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 2px; border-radius: 8px; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(2deg); } }
@keyframes floatAlt { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(5px) rotate(-2deg); } }
@keyframes travel { from { left: 0; opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } to { left: calc(100% - 10px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes toastBar { from { width: 100%; } to { width: 0; } }
.reveal { animation: fadeUp 0.25s var(--ease) both; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid transparent; font: 600 0.88rem "DM Sans", sans-serif; cursor: pointer; text-decoration: none; color: var(--ink);
  transition: transform 0.15s var(--ease), background-color 0.2s, border-color 0.2s; }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--coral); color: var(--coral-ink); }
.btn-primary:hover { background: #ff7d65; }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--soft); }
.btn-danger { background: var(--rose); color: var(--rose-ink); }
.btn-danger:hover { background: #ffd0d5; }
.btn-copied { background: var(--mint); color: var(--mint-ink); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 9px; }
.btn-lg { padding: 13px 22px; font-size: 0.95rem; }
.link-btn { background: none; border: 0; padding: 0; font: 600 0.82rem "DM Sans", sans-serif; color: var(--sky-ink); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 500; }
.checkbox-field { flex-direction: row; align-items: center; gap: 8px; padding-top: 22px; }
.checkbox-field input { width: auto; accent-color: var(--mint-deep); }
input, select { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font: inherit; font-size: 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; }
input:focus, select:focus { outline: none; border-color: var(--sky-deep); box-shadow: 0 0 0 3px rgba(47, 127, 209, 0.18); }
input:disabled { background: var(--soft); color: var(--muted); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.actions-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.subtitle { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.upload-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.upload-row input[type="file"] { flex: 1; min-width: 220px; }
.files-list { display: flex; flex-direction: column; gap: 10px; }
.file-row, .share-item, .mini-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.mini-row { padding: 10px 12px; flex-wrap: nowrap; }
.mini-row > div:first-child { min-width: 0; }
.mini-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 26px 12px; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 12px; }
.empty .btn { margin-top: 10px; }
.share-result { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--mint-wash); border: 1px solid var(--mint); }
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.shares-existing { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.shares-existing h3 { margin-bottom: 10px; }

/* Badges: green = active, amber = limit, grey = expired, red = revoked/blocked, blue = info */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; background: var(--sky-wash); color: var(--sky-ink); margin-right: 4px; }
.badge-ok { background: var(--mint); color: var(--mint-ink); }
.badge-bad { background: var(--rose); color: var(--rose-ink); }
.badge-warn { background: var(--amber); color: var(--amber-ink); }
.badge-muted { background: #e8edf0; color: #4b5a66; }

/* Toasts: solid, color-coded, auto-dismiss at 4s */
.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 100; width: min(360px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast-item { --c: var(--sky-deep); position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 10px; pointer-events: auto;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px; padding: 12px 12px 14px 14px;
  box-shadow: 0 8px 24px rgba(23, 35, 46, 0.12); animation: toastIn 0.25s var(--ease) both; transition: opacity 0.2s, transform 0.2s; }
.toast-item.out { opacity: 0; transform: translateX(16px); }
.toast-item svg { flex: none; margin-top: 2px; color: var(--c); }
.toast-msg { flex: 1; font-size: 0.88rem; font-weight: 500; }
.toast-x { background: none; border: 0; font-size: 1.2rem; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 2px; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--c); opacity: 0.55; animation: toastBar 4s linear forwards; }
.t-success { --c: var(--mint-deep); } .t-error { --c: #d23c52; } .t-info { --c: var(--sky-deep); } .t-warning { --c: #c58a00; }

/* App shell */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--rail); flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px; transition: width 0.25s var(--ease); }
.app.expanded .sidebar { width: 220px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; flex: none; }
.brand h1 { font-size: 1.3rem; }
.sidebar .brand { margin-bottom: 14px; padding-left: 2px; }
.sidebar .brand h1, .nav-label { display: none; }
.app.expanded .sidebar .brand h1, .app.expanded .nav-label { display: inline; }
.nav-pills { display: flex; flex-direction: column; gap: 6px; }
.nav-pill { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 13px; border-radius: 12px; border: 0;
  background: transparent; color: var(--muted); font: 600 0.9rem "DM Sans", sans-serif; cursor: pointer; transition: background-color 0.2s, color 0.2s; }
.nav-pill svg { flex: none; }
.nav-pill:hover { background: var(--soft); color: var(--ink); }
.nav-pill.active { background: var(--mint); color: var(--mint-ink); }
.nav-pill.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--mint-deep); }
.sidebar-toggle { margin-top: auto; }
.main { flex: 1; min-width: 0; padding: 0 28px 48px; max-width: 1180px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 0; }
.topbar h2 { font-size: 1.5rem; }
.user-bar { display: flex; align-items: center; gap: 10px; }
.tabbar { display: none; }

/* Overview */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { border-radius: 16px; padding: 16px 18px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.kpi.sky { background: var(--sky-wash); } .kpi.mint { background: var(--mint-wash); } .kpi.coral { background: var(--coral-wash); } .kpi.plain { background: var(--surface); }
.kpi-label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.kpi strong { font: 600 1.9rem "Bricolage Grotesque", sans-serif; letter-spacing: -0.02em; }
.spark { width: 100%; height: 32px; margin-top: 4px; }
.ov-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 14px; }
.ov-grid .wide { grid-column: 1 / -1; }
.rings { display: flex; justify-content: space-around; gap: 10px; }
.ring { text-align: center; }
.ring svg { width: 96px; height: 96px; }
.ring-num { font: 600 18px "Bricolage Grotesque", sans-serif; fill: var(--ink); }
.chart-wrap { width: 100%; min-height: 150px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.chart-legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }

/* Stats & tables */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat-label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.stat-value { margin-top: 4px; font: 600 1.7rem "Bricolage Grotesque", sans-serif; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.analytics-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.analytics-table th, .analytics-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.analytics-table th { color: var(--muted); font-size: 0.8rem; font-weight: 600; background: var(--soft); }
.analytics-table tr:last-child td { border-bottom: 0; }

/* Landing */
.lp-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; max-width: 1120px; margin: 0 auto; padding: 18px 24px; }
.lp-links { display: flex; gap: 22px; font-size: 0.9rem; font-weight: 500; }
.lp-links a { color: var(--muted); text-decoration: none; }
.lp-links a:hover { color: var(--ink); }
.lp-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; padding: 40px 0 64px; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); max-width: 16ch; }
.hero p.lede { margin: 16px 0 22px; color: var(--muted); font-size: 1.05rem; max-width: 50ch; }
.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.chip.mint { background: var(--mint); color: var(--mint-ink); animation: floatSlow 5.6s ease-in-out infinite; }
.chip.sky { background: var(--sky); color: var(--sky-ink); animation: floatAlt 6.2s ease-in-out infinite; }
.chip.soft { background: var(--surface); border: 1px solid var(--line-strong); animation: floatSlow 6.8s ease-in-out infinite; }
.auth-card { border-radius: 20px; padding: 26px; border-color: var(--line-strong); }
.auth-card h2 { font-size: 1.35rem; }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--soft); margin: 14px 0 18px; }
.tab { flex: 1; padding: 8px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font: 600 0.88rem "DM Sans", sans-serif; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(23, 35, 46, 0.1); }
.lp-section { padding: 56px 0; border-top: 1px solid var(--line); }
.lp-section > h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); max-width: 22ch; }
.lp-section > .lede { color: var(--muted); margin: 10px 0 26px; max-width: 60ch; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.step-no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font: 600 1rem "Bricolage Grotesque", sans-serif; margin-bottom: 10px; }
.step:nth-child(odd) .step-no { background: var(--mint); color: var(--mint-ink); }
.step:nth-child(even) .step-no { background: var(--sky); color: var(--sky-ink); }
.step p, .feature p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.flow { display: flex; flex-direction: column; gap: 26px; padding: 26px; }
.flow-lane h3 { margin-bottom: 12px; }
.flow-row { display: flex; align-items: stretch; gap: 0; flex-wrap: nowrap; }
.node { flex: 1; min-width: 0; border-radius: 12px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); font-weight: 600; font-size: 0.9rem; }
.node small { display: block; font-weight: 400; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.node.mint { background: var(--mint-wash); border-color: var(--mint); } .node.sky { background: var(--sky-wash); border-color: var(--sky); }
.node.coral { background: var(--coral-wash); border-color: var(--coral); }
.arrow { position: relative; flex: 0 0 44px; align-self: center; height: 2px; background: var(--line-strong); }
.arrow::after { content: ""; position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--sky-deep); animation: travel 2.4s ease-in-out infinite; }
.flow-note { margin-top: 10px; font-size: 0.85rem; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.feature .icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; }
.icon.mint { background: var(--mint); color: var(--mint-ink); } .icon.sky { background: var(--sky); color: var(--sky-ink); }
.features.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cta-band { margin: 20px 0 56px; padding: 36px; border-radius: 20px; background: var(--mint); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta-band h2 { font-size: 1.6rem; color: var(--mint-ink); }
.lp-foot { text-align: center; color: var(--muted); font-size: 0.82rem; padding: 0 0 32px; }

/* Public share page */
.share-wrap { max-width: 620px; margin: 0 auto; padding: 20px; }
.share-wrap .topbar { padding: 8px 0 20px; }
.trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { padding: 0 16px 100px; }
  .topbar h2 { font-size: 1.25rem; }
  .user-bar .muted { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ov-grid { grid-template-columns: 1fr; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar .nav-pill { flex-direction: column; gap: 3px; padding: 7px 4px; font-size: 0.72rem; justify-content: center; }
  .tabbar .nav-pill::before { display: none; }
  .tabbar .nav-label { display: inline; }
  .toast-stack { right: 16px; left: 16px; width: auto; }
  .hero { grid-template-columns: 1fr; padding-top: 16px; }
  .steps, .features, .features.two { grid-template-columns: 1fr; }
  .flow-row { flex-direction: column; }
  .arrow { flex: 0 0 22px; width: 2px; height: 22px; }
  .arrow::after { display: none; }
  .lp-links { display: none; }
}
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }