/* crave storage - same look as the mailbox: monochrome, solid rounded panels, soft glow. */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
  --radius: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
html[data-theme="dark"] {
  --bg: #000; --panel: #111113; --elev: #18181b; --fill: #212125; --fill-strong: #2a2a2f;
  --hair: #26262b; --hair-strong: #34343a;
  --text: #f5f5f7; --text-2: #9a9aa2; --text-3: #6e6e76;
  --ink: #fff; --ink-on: #000;
  --glow: rgba(255,255,255,.14); --glow-soft: rgba(255,255,255,.08); --bloom: rgba(255,255,255,.13);
  --warn: #fbbf24; --danger: #f87171;
  --shadow: 0 18px 50px rgba(0,0,0,.5);
}
html[data-theme="light"] {
  --bg: #ececf0; --panel: #fff; --elev: #f7f7f9; --fill: #f0f0f3; --fill-strong: #e6e6ea;
  --hair: #e2e2e7; --hair-strong: #d2d2d8;
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #a1a1a6;
  --ink: #111; --ink-on: #fff;
  --glow: rgba(0,0,0,.08); --glow-soft: rgba(0,0,0,.05); --bloom: rgba(0,0,0,.08);
  --warn: #b45309; --danger: #dc2626;
  --shadow: 0 18px 50px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.st {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme="dark"] .st-only-light, html[data-theme="light"] .st-only-dark { display: none; }
html[data-eyes="off"] .st-eyes { display: none; }

/* ── Eyes + wordmark ── */
.st-eyes { position: relative; width: 220px; max-width: 70vw; margin: 0 auto; }
.st-eyes::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: 200%;
  transform: translate(-50%, -50%);
  background: radial-gradient(closest-side, var(--bloom), transparent);
  pointer-events: none;
}
.st-eyes canvas { position: relative; display: block; width: 100%; height: auto; aspect-ratio: 400 / 150; }
.st-word { font-size: 28px; font-weight: 650; letter-spacing: -.045em; line-height: 1.1; text-shadow: 0 0 22px var(--glow); margin: 0; }
.st-word span { color: var(--text-2); font-weight: 500; }

/* ── Buttons ── */
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--ink-on); font-weight: 600; cursor: pointer;
  box-shadow: 0 0 26px var(--glow);
  transition: transform .2s var(--ease), box-shadow .2s;
}
.st-btn:hover { transform: translateY(-1px); box-shadow: 0 0 36px var(--glow); }
.st-btn:active { transform: scale(.97); }
.st-btn svg { width: 18px; height: 18px; stroke-width: 2.2; }
.st-icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 11px; background: none; color: var(--text-2); cursor: pointer;
}
.st-icon-btn:hover { background: var(--fill); color: var(--text); }
.st-icon-btn svg { width: 18px; height: 18px; }
.st-inline { display: contents; }
.st-mail-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px 0 11px; margin-right: 8px;
  border-radius: 11px; border: 1px solid var(--hair-strong); background: var(--elev);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 13px;
  transition: background-color .15s, box-shadow .2s;
}
.st-mail-btn:hover { background: var(--fill); box-shadow: 0 0 18px var(--glow-soft); }
.st-mail-btn svg { width: 17px; height: 17px; }
.st-back {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 14px;
  color: var(--text-2); text-decoration: none; font-size: 13px; font-weight: 500;
}
.st-back:hover { color: var(--text); }
.st-back svg { width: 15px; height: 15px; }

/* ── Login ── */
.st-login-page { display: grid; place-items: center; overflow: auto; }
.st-login {
  width: min(400px, calc(100vw - 32px)); margin: 24px auto; padding: 34px 28px 28px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 26px;
  box-shadow: var(--shadow), 0 0 60px var(--glow-soft);
  text-align: center;
}
.st-login .st-word { margin-top: 4px; }
.st-sub { color: var(--text-2); margin: 10px 0 22px; }
.st-form { display: grid; gap: 10px; text-align: left; }
.st-form input {
  height: 46px; padding: 0 14px; border-radius: 13px;
  border: 1px solid var(--hair-strong); background: var(--elev); outline: none;
}
.st-form input:focus { border-color: var(--text-2); box-shadow: 0 0 0 3px var(--glow-soft); }
.st-form .st-btn { margin-top: 6px; }
.st-err { color: var(--danger); font-size: 13px; }
.st-hint { color: var(--text-3); font-size: 12px; margin: 18px 0 0; }

/* ── App layout ── */
body.st:not(.st-login-page) { display: flex; flex-direction: column; padding: 12px; gap: 12px; height: 100vh; height: 100dvh; }
body.st:not(.st-login-page) { -webkit-user-select: none; user-select: none; }
.st-rename, .st-user { -webkit-user-select: text; user-select: text; }
.st-top {
  flex: none; display: flex; align-items: center; gap: 20px;
  padding: 10px 14px 10px 18px;
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius);
}
.st-brand { display: flex; align-items: center; gap: 4px; }
.st-eyes-sm { width: 92px; margin: 0; }
.st-eyes-sm::before { width: 160%; height: 260%; }
.st-top .st-word { font-size: 21px; }
.st-usage { flex: 1; max-width: 300px; margin-left: auto; }
.st-usage-text { font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.st-usage-text b { color: var(--text); font-weight: 600; }
.st-meter { height: 4px; border-radius: 4px; background: var(--fill-strong); overflow: hidden; }
.st-meter i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: inherit; box-shadow: 0 0 10px var(--glow); transition: width .4s var(--ease); }
.st-top-actions { display: flex; align-items: center; gap: 4px; }
.st-user { color: var(--text-2); font-size: 13px; margin-right: 8px; }

/* The explorer window: path bar, file area, status bar */
.st-win {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden;
}
.st-bar {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-bottom: 1px solid var(--hair);
}
.st-nav { display: flex; gap: 2px; }
.st-icon-btn:disabled { opacity: .35; cursor: default; background: none; }
.st-crumbs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px;
  height: 38px; padding: 0 6px; border-radius: 12px; background: var(--elev); border: 1px solid var(--hair);
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.st-crumbs::-webkit-scrollbar { display: none; }
.st-crumb {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 28px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text-2); cursor: pointer; font-size: 13px; font-weight: 500;
}
.st-crumb svg { width: 16px; height: 16px; }
.st-crumb:hover { background: var(--fill); color: var(--text); }
.st-crumb.st-here { color: var(--text); font-weight: 600; }
.st-sep { color: var(--text-3); flex: none; }
.st-bar-actions { display: flex; gap: 6px; }
.st-tool {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px;
  border-radius: 12px; border: 1px solid var(--hair-strong); background: var(--elev);
  color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color .15s, box-shadow .2s, transform .15s;
}
.st-tool:hover { background: var(--fill); }
.st-tool:active { transform: scale(.97); }
.st-tool svg { width: 17px; height: 17px; }
.st-tool-ink { background: var(--ink); color: var(--ink-on); border-color: var(--ink); box-shadow: 0 0 22px var(--glow); }
.st-tool-ink:hover { background: var(--ink); box-shadow: 0 0 32px var(--glow); }

.st-desk {
  flex: 1; min-height: 0; overflow: auto; position: relative; outline: none;
  padding: 18px; user-select: none;
}
.st-band {
  position: absolute; z-index: 3; pointer-events: none;
  border: 1px solid var(--text-2); border-radius: 4px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.st-band[hidden] { display: none; }
.st-status {
  flex: none; display: flex; gap: 18px; align-items: center;
  padding: 8px 16px; border-top: 1px solid var(--hair);
  font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.st-status-note { margin-left: auto; color: var(--text-3); }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 10px; align-content: start; }
.st-empty {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px;
  text-align: center; color: var(--text-2); padding: 24px; pointer-events: none;
}
.st-empty[hidden] { display: none; }
.st-empty svg { width: 54px; height: 54px; stroke-width: 1.4; color: var(--text); filter: drop-shadow(0 0 14px var(--glow)); margin-bottom: 6px; }
.st-empty b { color: var(--text); font-size: 17px; font-weight: 600; }
.st-empty span { max-width: 340px; font-size: 13px; }

/* ── File tiles ── */
.st-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px 10px; border-radius: 16px; cursor: default; outline: none;
  border: 1px solid transparent; user-select: none;
  transition: background-color .15s, border-color .15s, box-shadow .2s;
}
.st-tile:hover { background: var(--fill); }
.st-tile:focus-visible { border-color: var(--hair-strong); }
.st-tile.st-selected { background: var(--fill); border-color: var(--hair-strong); box-shadow: 0 0 0 1px var(--hair), 0 0 22px var(--glow); }
.st-ico { position: relative; width: 56px; height: 56px; display: grid; place-items: center; }
.st-file-svg { width: 52px; height: 52px; stroke-width: 1.3; color: var(--text); }
.st-ext {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  padding: 1px 5px; border-radius: 5px; background: var(--ink); color: var(--ink-on);
  font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.st-ext:empty { display: none; }
.st-name {
  width: 100%; text-align: center; font-size: 12.5px; font-weight: 500; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.st-meta { display: grid; justify-items: center; gap: 1px; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.st-size { color: var(--text-3); }
.st-tile.st-soon .st-left { color: var(--warn); }

/* Upload in progress: a ring around the icon */
.st-uploading { opacity: .85; }
.st-ring { position: absolute; inset: -4px; width: 64px; height: 64px; transform: rotate(-90deg); }
.st-ring circle { stroke: var(--hair-strong); stroke-width: 2; }
.st-ring .st-ring-fill { stroke: var(--ink); stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transition: stroke-dashoffset .2s; filter: drop-shadow(0 0 4px var(--glow)); }
.st-uploading .st-file-svg { width: 34px; height: 34px; color: var(--text-2); }
.st-saving .st-ring { animation: st-spin 1.2s linear infinite; }
.st-saving .st-ring-fill { stroke-dashoffset: 70 !important; }
@keyframes st-spin { to { transform: rotate(270deg); } }

/* Folders, moving, cutting, renaming */
.st-folder-svg { width: 54px; height: 54px; stroke-width: 1.3; color: var(--text); fill: var(--fill-strong); }
.st-dir .st-meta { color: var(--text-3); }
.st-tile.st-drop-here, .st-crumb.st-drop-here {
  background: var(--fill-strong); border-color: var(--text-2);
  box-shadow: 0 0 0 1px var(--text-2), 0 0 26px var(--glow);
}
.st-tile.st-ghost { opacity: .45; }
.st-tile.st-cut .st-ico { opacity: .4; }
.st-rename {
  width: 100%; resize: none; text-align: center; font-size: 12.5px; font-weight: 500; line-height: 1.3;
  padding: 3px 5px; border-radius: 7px; border: 1px solid var(--text-2); background: var(--bg); color: var(--text);
  outline: none; box-shadow: 0 0 0 3px var(--glow-soft); user-select: text;
}

/* ── Drag overlay ── */
.st-drop {
  position: fixed; inset: 12px; z-index: 20; border-radius: var(--radius);
  display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 2px dashed var(--text-2);
  opacity: 0; transition: opacity .15s;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.st-drop.st-on { opacity: 1; }
.st-drop div { display: grid; justify-items: center; gap: 10px; font-size: 18px; }
.st-drop svg { width: 46px; height: 46px; filter: drop-shadow(0 0 16px var(--glow)); }

/* ── Context menu + toasts ── */
.st-menu {
  position: fixed; z-index: 30; min-width: 210px; padding: 6px;
  background: var(--panel); border: 1px solid var(--hair-strong); border-radius: 14px;
  box-shadow: var(--shadow);
}
.st-menu[hidden] { display: none; }
.st-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 9px;
  background: none; cursor: pointer;
}
.st-menu button svg { width: 16px; height: 16px; flex: none; color: var(--text-2); }
.st-menu button span { flex: 1; }
.st-menu kbd { font: 11px var(--font); color: var(--text-3); }
.st-menu .st-danger svg { color: var(--danger); }
.st-menu-sep { height: 1px; margin: 5px 6px; background: var(--hair); }

/* "Move to" dialog */
.st-modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.st-modal[hidden] { display: none; }
.st-dialog {
  width: min(440px, 100%); max-height: min(560px, calc(100vh - 32px)); display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--hair-strong); border-radius: 22px; padding: 18px;
  box-shadow: var(--shadow), 0 0 60px var(--glow-soft);
}
.st-dialog h2 { margin: 2px 4px 12px; font-size: 17px; }
.st-tree { flex: 1; min-height: 120px; overflow: auto; border: 1px solid var(--hair); border-radius: 14px; background: var(--elev); padding: 6px; }
.st-tree-row {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 36px; padding-right: 10px;
  border: 0; border-radius: 9px; background: none; text-align: left; cursor: pointer; font-size: 13.5px;
}
.st-tree-row svg { width: 17px; height: 17px; flex: none; color: var(--text-2); }
.st-tree-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tree-row:hover { background: var(--fill); }
.st-tree-row.st-on { background: var(--ink); color: var(--ink-on); }
.st-tree-row.st-on svg { color: var(--ink-on); }
.st-tree-row:disabled { opacity: .35; cursor: not-allowed; background: none; }
.st-dialog-foot { display: flex; gap: 8px; margin-top: 14px; }
.st-spacer { flex: 1; }
.st-menu button:hover, .st-menu button:focus { background: var(--fill); outline: none; }
.st-menu .st-danger { color: var(--danger); }
.st-toasts { position: fixed; right: 20px; bottom: 26px; z-index: 40; display: grid; gap: 8px; justify-items: end; }
.st-toast {
  max-width: min(380px, calc(100vw - 40px)); padding: 11px 15px; border-radius: 13px;
  background: var(--ink); color: var(--ink-on); font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow); animation: st-in .25s var(--ease);
  transition: opacity .3s, transform .3s;
}
.st-toast-err { background: var(--panel); color: var(--danger); border: 1px solid var(--hair-strong); }
.st-toast.st-out { opacity: 0; transform: translateY(6px); }
@keyframes st-in { from { opacity: 0; transform: translateY(8px); } }

/* ── Phones ── */
@media (max-width: 640px) {
  body.st:not(.st-login-page) { padding: 8px; gap: 8px; }
  .st-top { flex-wrap: wrap; gap: 10px; }
  .st-usage { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .st-user { display: none; }
  .st-mail-btn { margin-right: 2px; }
  .st-top-actions { margin-left: auto; }
  .st-desk { padding: 12px 8px; }
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
  .st-bar { flex-wrap: wrap; padding: 8px; gap: 8px; }
  .st-crumbs { order: 3; flex-basis: 100%; }
  .st-bar-actions { margin-left: auto; }
  .st-tool span { display: none; }
  .st-tool { padding: 0 11px; }
  .st-status-note { display: none; }
  .st-toasts { left: 12px; right: 12px; bottom: 16px; justify-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
