/* ══ ZedVault — Proton Drive style light UI, desktop + mobile ══ */
:root {
  --bg: #f6f6f9;
  --panel: #ffffff;
  --sidebar: #ffffff;
  --border: #e9e9f0;
  --border-soft: #f0f0f5;
  --text: #1f1f26;
  --text-dim: #6f6f7c;
  --text-faint: #a9a9b5;
  --accent: #6d4aff;
  --accent-hi: #5b3df0;
  --accent-soft: #f1edff;
  --accent-border: #ddd3ff;
  --danger: #e03131;
  --danger-soft: #fdecec;
  --ok: #0ca678;
  --surface: #ffffff;
  --hover: #f4f4f8;
  --input-bg: #f1f1f5;
  --radius: 10px;
  --shadow: 0 10px 34px rgba(31, 31, 46, .13);
  --shadow-sm: 0 2px 10px rgba(31, 31, 46, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--text-dim); font-size: 14px; }
.spacer { flex: 1; }
button { font-family: inherit; }

/* ── Buttons / inputs ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 9px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
  text-decoration: none; color: var(--text); background: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(109, 74, 255, .3); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-dim { background: var(--input-bg); border-color: transparent; color: var(--text); }
.btn-dim:hover { background: var(--hover); }
.btn-ghost { color: var(--text-dim); }
.btn-ghost:hover { background: var(--hover); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-file { cursor: pointer; overflow: hidden; position: relative; }
.icon-btn {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 17px; cursor: pointer; padding: 8px; border-radius: 8px; line-height: 1;
}
.icon-btn:hover { background: #f1f1f6; color: var(--text); }

input[type=text], input[type=password], input[type=search], select {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109, 74, 255, .14); }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--text-dim); font-weight: 600; }
label input, label select { margin-top: 6px; font-weight: 400; }
.form-error {
  background: var(--danger-soft); border: 1px solid #f5c2c2;
  color: #c92a2a; padding: 9px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 12px;
}

/* ── Login ── */
.login-view {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background:
    radial-gradient(900px 480px at 15% 0%, #ece7ff 0%, transparent 60%),
    radial-gradient(900px 520px at 90% 100%, #e4f3ff 0%, transparent 55%),
    #f7f7fa;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px; padding: 40px 34px;
  box-shadow: var(--shadow);
}
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 25px; margin: 14px 0 5px; letter-spacing: -.3px; }
.login-logo p { color: var(--text-dim); font-size: 14px; }
.logo-mark {
  width: 58px; height: 58px; border-radius: 17px; margin: 0 auto;
  background: linear-gradient(135deg, #6d4aff, #9d7bff);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: #fff;
  box-shadow: 0 6px 18px rgba(109, 74, 255, .35);
}
.logo-mark.sm { width: 36px; height: 36px; font-size: 20px; border-radius: 11px; margin: 0; box-shadow: none; }

/* ── Main layout ── */
.main-view { display: flex; height: 100dvh; overflow: hidden; }
.sidebar {
  width: 276px; flex-shrink: 0; background: var(--sidebar);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  padding: 20px 16px 16px; z-index: 60;
}
.sidebar-head { display: flex; align-items: center; gap: 11px; padding: 2px 4px 18px; }
.logo-name { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.btn-new {
  width: 100%; margin-bottom: 18px; padding: 11px 18px; font-size: 15px;
  border-radius: 10px; box-shadow: 0 3px 10px rgba(109, 74, 255, .28);
}
.nav-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; border: none; background: none;
  font-size: 14.5px; font-weight: 500; color: var(--text); width: 100%; text-align: left;
}
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .nav-ico { width: 22px; text-align: center; font-size: 17px; }
.sidebar-section { flex: 1; overflow-y: auto; }
.sidebar-label { font-size: 11px; letter-spacing: 1.2px; color: var(--text-faint); padding: 8px 10px 8px; font-weight: 700; }
.storage-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.storage-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.storage-item:hover { background: var(--hover); }
.storage-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.storage-item .st-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-item .st-menu { opacity: 0; padding: 5px; }
.storage-item:hover .st-menu { opacity: 1; }
.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 12px; }
.foot-note { font-size: 12px; color: var(--text-faint); text-align: center; }
.sidebar-scrim { display: none; }

/* ── File type badges ── */
.fthumb {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 800; letter-spacing: .4px;
}
.fthumb.sm { width: 30px; height: 30px; border-radius: 8px; font-size: 9px; }
.fthumb svg { width: 22px; height: 22px; }
.fthumb.sm svg { width: 16px; height: 16px; }
.f-dir   { background: var(--accent-soft); color: var(--accent); }
.f-img   { background: #e7f6ef; color: #0b8a5f; }
.f-video { background: #fdeef3; color: #d6336c; }
.f-audio { background: #f0ebff; color: #7048e8; }
.f-pdf   { background: #fdecec; color: #e03131; }
.f-doc   { background: #e8f1fd; color: #1971c2; }
.f-sheet { background: #e6f6ec; color: #2b8a3e; }
.f-zip   { background: #fff3df; color: #e67700; }
.f-txt   { background: #f1f2f5; color: #868e96; }
.f-file  { background: #f1f2f5; color: #868e96; }
.f-cloud { background: var(--accent-soft); color: var(--accent); }
.f-local { background: #eef0f4; color: #5c5f6b; }

.content { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: var(--panel); border-bottom: 1px solid var(--border);
}
.search-wrap { flex: 1; max-width: 520px; margin: 0 auto; position: relative; }
.search-wrap input {
  width: 100%; border: none; background: var(--input-bg); border-radius: 999px;
  padding: 10px 18px 10px 42px; font-size: 14px;
}
.search-wrap input:focus { background: var(--surface); box-shadow: 0 0 0 3px rgba(109, 74, 255, .14); border: none; }
.search-wrap::before {
  content: ""; position: absolute; left: 15px; top: 50%; width: 16px; height: 16px;
  transform: translateY(-50%); background: var(--text-faint); pointer-events: none;
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #6d4aff, #9d7bff); color: #fff;
  font-size: 16px; font-weight: 700;
}
.avatar-btn:hover { filter: brightness(1.05); }
.user-menu {
  position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 210px; padding: 6px;
}
.user-menu .um-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border-soft); margin-bottom: 4px; }
.user-menu .um-head b { display: block; font-size: 14px; }
.user-menu .um-head span { font-size: 12px; color: var(--text-faint); }

/* ── New-button dropdown ── */
.new-menu {
  position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; padding: 6px;
}
.menu-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text); font-size: 14px; font-weight: 500;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.menu-item:hover { background: var(--hover); }
.menu-item .fthumb { width: 32px; height: 32px; border-radius: 8px; }

/* ── Content header / breadcrumb ── */
.content-head { padding: 20px 28px 6px; }
.content-title { font-size: 21px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 8px; }
.breadcrumb { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.crumb {
  background: none; border: none; color: var(--text-dim); font-size: 13.5px;
  padding: 5px 9px; border-radius: 7px; cursor: pointer; font-weight: 500;
}
.crumb:hover { background: var(--hover); color: var(--text); }
.crumb.current { color: var(--text); font-weight: 700; pointer-events: none; background: none; }
.crumb-sep { color: var(--text-faint); font-size: 13px; }
.breadcrumb.small { margin-bottom: 10px; }

/* ── File list ── */
.file-area { flex: 1; overflow-y: auto; padding: 6px 28px 90px; position: relative; }
.file-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm);
}
.file-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px 170px 46px;
  align-items: center; gap: 10px; padding: 9px 16px;
}
.file-row.head {
  font-size: 11px; color: var(--text-faint); font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; border-bottom: 1px solid var(--border);
  padding-top: 13px; padding-bottom: 11px; background: var(--panel);
}
.file-row.item { cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.file-row.item:last-child { border-bottom: none; }
.file-row.item:hover { background: var(--hover); }
.col-name { display: flex; align-items: center; gap: 13px; min-width: 0; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14.5px; }
.file-subpath { display: block; font-size: 12px; color: var(--text-faint); font-weight: 400; }
.col-size, .col-modified { color: var(--text-dim); font-size: 13px; white-space: nowrap; }
.col-actions { text-align: right; }
.row-menu-btn { opacity: 0; border-radius: 50%; }
.file-row.item:hover .row-menu-btn, .file-row.item:focus-within .row-menu-btn { opacity: 1; }
.row-menu-btn:hover { background: var(--hover); }

/* grid view */
.file-area.grid-view .file-card { background: none; border: none; box-shadow: none; overflow: visible; }
.file-area.grid-view #file-list-head { display: none; }
.file-area.grid-view #file-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; padding: 6px 2px;
}
.file-area.grid-view .file-row.item {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 10px 16px; gap: 0; box-shadow: var(--shadow-sm);
}
.file-area.grid-view .file-row.item:hover { border-color: var(--accent-border); box-shadow: 0 6px 18px rgba(109, 74, 255, .12); background: var(--surface); }
.file-area.grid-view .col-name { flex-direction: column; gap: 12px; width: 100%; }
.file-area.grid-view .fthumb { width: 56px; height: 56px; border-radius: 15px; font-size: 12px; }
.file-area.grid-view .fthumb svg { width: 28px; height: 28px; }
.file-area.grid-view .file-name {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; font-size: 13px; line-height: 1.4; word-break: break-word;
}
.file-area.grid-view .col-size, .file-area.grid-view .col-modified, .file-area.grid-view .col-actions { display: none; }

.empty-state { text-align: center; padding: 90px 20px; color: var(--text-dim); }
.empty-illo {
  width: 120px; height: 120px; border-radius: 34px; margin: 0 auto 22px;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
}
.empty-illo svg { width: 56px; height: 56px; color: var(--accent); }
.empty-state h3 { font-size: 17px; color: var(--text); margin-bottom: 8px; }
.empty-state p { line-height: 1.7; font-size: 14px; }

/* ── Drop overlay ── */
.drop-overlay {
  position: fixed; inset: 0; z-index: 200; background: rgba(109, 74, 255, .07);
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.drop-hint {
  border: 2px dashed var(--accent); border-radius: 22px; padding: 58px 76px;
  font-size: 21px; font-weight: 700; color: var(--accent); background: var(--surface);
  box-shadow: var(--shadow);
}

/* ── Upload dock ── */
.upload-dock {
  position: fixed; right: 20px; bottom: 20px; width: 370px; max-width: calc(100vw - 40px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); z-index: 150; overflow: hidden;
}
.upload-dock-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}
.upload-list { max-height: 300px; overflow-y: auto; }
.upload-item { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.upload-item:last-child { border-bottom: none; }
.upload-item .up-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 7px; font-weight: 500; }
.upload-item .up-status { color: var(--text-dim); font-size: 12px; margin-top: 5px; }
.upload-item .up-status.err { color: var(--danger); }
.upload-item .up-status.done { color: var(--ok); }
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

/* ── Modals ── */
.modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(35, 33, 48, .45);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  animation: fadeIn .15s ease;
}
.modal-card {
  background: var(--surface); border: none; border-radius: 18px;
  padding: 28px; width: 100%; max-width: 470px; max-height: 90dvh; overflow-y: auto;
  box-shadow: var(--shadow); animation: popIn .18s ease;
}
.modal-card.narrow { max-width: 390px; }
.modal-card h2 { font-size: 19px; margin-bottom: 18px; letter-spacing: -.2px; }
.modal-card h3 { font-size: 12px; margin: 22px 0 10px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; }
.modal-actions { display: flex; gap: 8px; margin-top: 20px; align-items: center; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.move-list { border: 1px solid var(--border); border-radius: 10px; max-height: 260px; overflow-y: auto; }
.move-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  cursor: pointer; border-bottom: 1px solid var(--border-soft); font-size: 14px; font-weight: 500;
}
.move-row:last-child { border-bottom: none; }
.move-row:hover { background: var(--hover); }

.settings-storage-list { display: flex; flex-direction: column; gap: 8px; }
.settings-storage-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--hover); border-radius: 10px; font-size: 14px;
}
.settings-storage-row .st-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* ── Context menu ── */
.ctx-menu {
  position: fixed; z-index: 400; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); min-width: 190px; padding: 6px;
}
.ctx-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; color: var(--text); font-size: 14px; font-weight: 500;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
}
.ctx-item:hover { background: var(--hover); }
.ctx-item.danger { color: var(--danger); }
.ctx-item.danger:hover { background: var(--danger-soft); }

/* ── Toasts ── */
.toast-shelf { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 500; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #23212e; color: #fff;
  padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow); animation: popIn .2s ease; max-width: calc(100vw - 40px);
}
.toast.error { background: #3a1d22; }
.toast.ok { background: #123b2f; }

/* ── Responsive ── */
.only-mobile { display: none !important; }
@media (max-width: 900px) {
  .only-mobile { display: inline-flex !important; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; transform: translateX(-105%);
    transition: transform .22s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .sidebar-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(35, 33, 48, .4); opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .file-row { grid-template-columns: minmax(0, 1fr) 46px; }
  .file-row .col-size, .file-row .col-modified { display: none; }
  .row-menu-btn { opacity: 1; }
  .storage-item .st-menu { opacity: 1; }
  .search-wrap { max-width: none; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .content-head { padding: 16px 16px 4px; }
  .file-area { padding: 4px 12px 110px; }
  .modal-card { padding: 22px; }
  .file-area.grid-view #file-list { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
}

/* ══ Dark theme ══ */
html[data-theme="dark"] {
  --bg: #2c2b25;
  --panel: #35342c;
  --sidebar: #35342c;
  --surface: #3a3930;
  --border: #4a493d;
  --border-soft: #403f35;
  --text: #f0eee6;
  --text-dim: #b8b5a6;
  --text-faint: #85816f;
  --accent-soft: rgba(109, 74, 255, .2);
  --accent-border: #4b3f96;
  --hover: #403f35;
  --input-bg: #403f35;
  --danger-soft: rgba(224, 49, 49, .16);
  --shadow: 0 10px 34px rgba(0, 0, 0, .55);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .4);
}
html[data-theme="dark"] .login-view {
  background:
    radial-gradient(900px 480px at 15% 0%, #251d52 0%, transparent 60%),
    radial-gradient(900px 520px at 90% 100%, #10283f 0%, transparent 55%),
    #2c2b25;
}
html[data-theme="dark"] .f-img   { background: rgba(12, 166, 120, .18); color: #3ddc97; }
html[data-theme="dark"] .f-video { background: rgba(214, 51, 108, .18); color: #f783ac; }
html[data-theme="dark"] .f-audio { background: rgba(112, 72, 232, .22); color: #b197fc; }
html[data-theme="dark"] .f-pdf   { background: rgba(224, 49, 49, .18); color: #ff8787; }
html[data-theme="dark"] .f-doc   { background: rgba(25, 113, 194, .22); color: #74c0fc; }
html[data-theme="dark"] .f-sheet { background: rgba(43, 138, 62, .2); color: #69db7c; }
html[data-theme="dark"] .f-zip   { background: rgba(230, 119, 0, .18); color: #ffc078; }
html[data-theme="dark"] .f-txt,
html[data-theme="dark"] .f-file  { background: #403f35; color: #b8b5a6; }
html[data-theme="dark"] .f-local { background: #403f35; color: #b8b5a6; }
html[data-theme="dark"] .toast { background: #f1f1f5; color: #1f1f26; }
html[data-theme="dark"] .toast.error { background: #ffd9d9; }
html[data-theme="dark"] .toast.ok { background: #d3f2e3; }

/* ══ Editor modal ══ */
.editor-card { max-width: 880px; height: min(82dvh, 760px); display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.editor-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px; border-bottom: 1px solid var(--border-soft); }
.editor-head b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.editor-head .file-sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }
#editor-textarea {
  flex: 1; border: none; resize: none; padding: 18px 20px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13.5px; line-height: 1.7; background: var(--surface); color: var(--text);
  outline: none; tab-size: 2;
}
.editor-foot { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--border-soft); }
.editor-status { font-size: 12.5px; color: var(--text-faint); }
.editor-status.dirty { color: var(--accent); font-weight: 600; }

/* ══ Appearance (accent color) ══ */
.accent-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 12px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; flex: none; }
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.accent-custom { display: flex; align-items: center; gap: 10px; }
.accent-custom input[type="color"] { width: 40px; height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 3px; cursor: pointer; }
.accent-custom label { font-size: 13.5px; color: var(--text-dim); }

/* ══ Editor markdown preview ══ */
.seg { display: inline-flex; background: var(--hover); border-radius: 9px; padding: 3px; gap: 2px; }
.seg-btn { border: none; background: transparent; color: var(--text-dim); font-size: 12.5px; font-weight: 600; padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.md-preview { flex: 1; overflow: auto; padding: 22px 24px; font-size: 14.5px; line-height: 1.75; color: var(--text); word-break: break-word; }
.md-loading { color: var(--text-faint); font-size: 13px; padding: 8px 0; }
.md-preview h1, .md-preview h2, .md-preview h3 { line-height: 1.3; margin: 1.2em 0 .55em; }
.md-preview h1 { font-size: 1.65em; border-bottom: 1px solid var(--border-soft); padding-bottom: .4em; margin-top: 0; }
.md-preview h2 { font-size: 1.35em; border-bottom: 1px solid var(--border-soft); padding-bottom: .3em; }
.md-preview h3 { font-size: 1.15em; }
.md-preview p, .md-preview ul, .md-preview ol { margin: .75em 0; }
.md-preview ul, .md-preview ol { padding-left: 1.6em; }
.md-preview li { margin: .28em 0; }
.md-preview code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .86em; background: var(--hover); border-radius: 6px; padding: 2px 6px; }
.md-preview pre { background: #23212e; color: #ececf1; border-radius: 12px; padding: 16px; overflow: auto; }
.md-preview pre code { background: none; padding: 0; color: inherit; }
.md-preview blockquote { margin: .75em 0; padding: 2px 0 2px 14px; border-left: 3px solid var(--accent); color: var(--text-dim); }
.md-preview table { border-collapse: collapse; width: 100%; margin: .75em 0; font-size: .92em; }
.md-preview th, .md-preview td { border: 1px solid var(--border-soft); padding: 8px 12px; text-align: left; }
.md-preview th { background: var(--hover); }
.md-preview img { max-width: 100%; border-radius: 10px; }
.md-preview a { color: var(--accent); }
.md-preview hr { border: none; border-top: 1px solid var(--border-soft); margin: 1.4em 0; }

/* ══ Share modal / list ══ */
.share-link-row { display: flex; gap: 8px; margin: 4px 0 12px; }
.share-link-row input { flex: 1; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.share-note { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.share-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--hover); border-radius: 10px; font-size: 13.5px; }
.share-row .sh-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.share-row .sh-date { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.share-empty { font-size: 13px; color: var(--text-faint); padding: 6px 2px; }
