/* NoteShare – refreshed theme */

:root {
  --bg: #0f172a;
  --bg-alt: #1e1b4b;
  --card: rgba(15, 23, 42, 0.7);
  --card-border: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --text-muted: #cbd5f5;
  --accent: #22d3ee;
  --accent-dark: #0ea5e9;
  --danger: #f87171;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.45);
  --scroll-reserve: 0px;
  --panel-gutter: 10px;
  --btn-glow: 0 6px 16px rgba(14, 165, 233, 0.18);
  --btn-glow-hover: 0 10px 24px rgba(14, 165, 233, 0.22);
  --focus-ring: 0 0 0 3px rgba(34, 211, 238, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: radial-gradient(circle at 15% 20%, #1f1b3d, #0a1020 55%);
  background-attachment: fixed;
  background-color: #0a1020;
  scrollbar-color: rgba(34, 211, 238, 0.35) rgba(15, 23, 42, 0.25);
}

/* Fixed backgrounds can be janky on some devices; avoid it for mobile + reduced-motion users. */
@media (max-width: 900px), (prefers-reduced-motion: reduce) {
  html { background-attachment: scroll; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: transparent;
  padding-right: var(--scroll-reserve);
}

/* Scrollbar theming (prevents a white gutter/track on some platforms). */
* {
  scrollbar-color: rgba(34, 211, 238, 0.35) rgba(15, 23, 42, 0.25);
}
*::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}
*::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.25);
}
*::-webkit-scrollbar-thumb {
  background: rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  border: 3px solid rgba(15, 23, 42, 0.25);
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.5);
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--text); }
a:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.8);
  margin: 0 0 4px;
}
.page-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 6px 0 10px;
  background: linear-gradient(120deg, rgba(34, 211, 238, 0.12), rgba(59, 130, 246, 0.08));
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 10px 12px;
}
.hero-text {
  display: grid;
  gap: 4px;
}
.hero-title { margin: 0; font-size: 1.4rem; }
.hero-with-tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.hero-title-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.hero-after-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hero-divider {
  color: var(--text-muted);
}
.hero-client-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
}
.hero-select-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 5px 15px 4px 8px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 3px;
}
.hero-select-trigger:hover {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.09);
}
.hero-select-trigger:focus {
  outline: 1px solid rgba(34, 211, 238, 0.35);
  outline-offset: 1px;
}
.hero-select-label {
  display: inline-block;
  white-space: nowrap;
}
.hero-caret {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}
.hero-select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 160px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
  padding: 6px;
  display: grid;
  gap: 4px;
  z-index: 20;
}
.hero-select-option {
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  padding: 7px 10px;
  font-weight: 600;
  cursor: pointer;
}
.hero-select-option[aria-selected="true"] {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}
.hero-select-option:hover {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(148, 163, 184, 0.08);
}
.hero-caret {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5f5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.site-header::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(-1 * var(--scroll-reserve));
  width: var(--scroll-reserve);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  pointer-events: none;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
}
.nav-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
}
.nav-toggle:hover,
.nav-toggle:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
}
.nav-toggle__chevron {
  width: 12px;
  height: 12px;
  display: inline-block;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23cbd5f5' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.18s ease;
}
.site-header[data-nav-open="true"] .nav-toggle__chevron {
  transform: rotate(180deg);
}
.nav a {
  color: var(--text-muted);
  margin-left: 18px;
  font-size: 0.95rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.nav-activity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.25);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
}
.nav a:hover,
.nav a:focus {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 211, 238, 0.25);
}
.nav a[aria-current="page"] {
  color: var(--text);
}
.nav a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.site-footer {
  margin-top: 64px;
  padding: 30px 0;
  text-align: center;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  position: relative;
}
.site-footer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(-1 * var(--scroll-reserve));
  width: var(--scroll-reserve);
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  pointer-events: none;
}
.site-footer .footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-logout {
  color: var(--accent);
  font-weight: 600;
}
.footer-logout:hover,
.footer-logout:focus {
  color: var(--text);
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 12px;
}
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
h2 { font-size: 1.4rem; margin-top: 20px; }
p { margin: 0 0 12px; color: var(--text-muted); }
small { color: var(--text-muted); }
.panel-heading h2 {
  margin: 4px 0 6px;
  font-size: 1.4rem;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95em;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.18);
  color: var(--text);
  padding: 0.12em 0.35em;
  border-radius: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}
.card h2,
.card-subtle h2,
.upload-panel h2 {
  margin-top: 16px;
}
.card h2:first-of-type,
.card-subtle h2:first-of-type,
.upload-panel h2:first-of-type {
  margin-top: 0;
}
.card h3,
.card-subtle h3,
.upload-panel h3 {
  margin-top: 14px;
}
.card h3:first-of-type,
.card-subtle h3:first-of-type,
.upload-panel h3:first-of-type {
  margin-top: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.card-subtle {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 14px 16px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.28);
}
.upload-panel {
  margin-top: 5px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.upload-panel h2 {
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: var(--btn-glow);
  text-decoration: none;
}
button {
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.1;
  color: inherit;
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
}
.icon-only {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
}
.btn:hover,
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--btn-glow-hover);
}
.btn:focus-visible,
button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.btn:focus-visible {
  box-shadow: var(--btn-glow), var(--focus-ring);
}
.btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  box-shadow: var(--btn-glow);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  border-color: rgba(148, 163, 184, 0.3);
  box-shadow: var(--btn-glow-hover);
}
.btn-ghost:focus-visible {
  outline: none;
  box-shadow: var(--btn-glow), var(--focus-ring);
}
.btn-xs {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 10px;
}

.form { max-width: 720px; }
.panel-shell .form { max-width: none; }
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  --file-field-padding: 10px;
  --file-field-bg: rgba(15, 23, 42, 0.65);
  --file-field-border: 1px dashed rgba(226, 232, 240, 0.35);
  --file-btn-padding: 8px 16px;
  --file-btn-margin-right: 12px;
  --file-btn-bg: linear-gradient(135deg, var(--accent), var(--accent-dark));
  --file-btn-color: #0f172a;
  --file-btn-radius: 999px;
}

.input-with-toggle {
  position: relative;
}

.input-with-toggle > input {
  padding-right: 92px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.password-toggle:hover:not(:disabled) {
  border-color: rgba(148, 163, 184, 0.3);
}

.password-toggle:focus-visible {
  outline: none;
  box-shadow: var(--btn-glow), var(--focus-ring);
}

.password-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden-file-input {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.folder-picker-row,
.file-picker-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: var(--file-field-padding);
  background: var(--file-field-bg);
  border: var(--file-field-border);
  border-radius: 14px;
  cursor: pointer;
}

.folder-picker-row:focus-within,
.file-picker-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  outline: none;
}

.folder-picker-row[aria-disabled="true"],
.file-picker-row[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.folder-picker-row .file-chooser-button,
.file-picker-row .file-chooser-button {
  border: none;
  border-radius: var(--file-btn-radius);
  padding: var(--file-btn-padding);
  margin-right: var(--file-btn-margin-right);
  background: var(--file-btn-bg);
  color: var(--file-btn-color);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.1;
}

.folder-picker-row .file-chooser-button:hover:not(:disabled),
.file-picker-row .file-chooser-button:hover:not(:disabled) {
  opacity: 0.9;
}

.folder-picker-row .file-chooser-button:disabled,
.file-picker-row .file-chooser-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.folder-picker-row .file-chooser-text,
.file-picker-row .file-chooser-text {
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.1;
  user-select: none;
}
label {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(226, 232, 240, 0.2);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  font-size: 1rem;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
  outline: none;
}
.form-row textarea { min-height: 140px; resize: vertical; }
.form-row input[type="file"] {
  padding: var(--file-field-padding);
  background: var(--file-field-bg);
  border: var(--file-field-border);
  cursor: pointer;
}
.form-row input[type="file"]::file-selector-button,
.form-row input[type="file"]::-webkit-file-upload-button {
  border: none;
  border-radius: var(--file-btn-radius);
  padding: var(--file-btn-padding);
  margin-right: var(--file-btn-margin-right);
  background: var(--file-btn-bg);
  color: var(--file-btn-color);
  font-weight: 600;
  cursor: pointer;
}
.form-row input[type="file"]::file-selector-button:hover,
.form-row input[type="file"]::-webkit-file-upload-button:hover {
  opacity: 0.9;
}

.notice,
.error {
  border-radius: 16px;
  padding: 12px 16px;
  font-weight: 500;
}
.notice {
  background: rgba(14, 165, 233, 0.15);
  color: var(--text);
}
.error {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
}
.pill-soft {
  background: rgba(34, 211, 238, 0.16);
  color: var(--text);
  border: 1px solid rgba(34, 211, 238, 0.35);
}
.pill-ghost {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.panel-shell {
  display: flex;
  flex-direction: column;
  padding: var(--panel-gutter);
}
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 5px;
}
.user-last-login {
  margin: 4px 0 8px;
  font-size: 0.85rem;
}
.form-row-tight {
  margin-bottom: 0px;
}
.file-surface {
  background: transparent;
  border: none;
  box-shadow: none;
}
.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 6px;
}
.upload-panel .upload-file-input {
  display: block;
  width: 100%;
  margin-bottom: 8px;
}
.panel-shell h3 {
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: 100%;
  min-width: 680px;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
}
.table th,
.table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(203, 213, 225, 0.78);
  background: rgba(15, 23, 42, 0.55);
}
.table tbody tr:hover {
  background: rgba(148, 163, 184, 0.08);
}

.activity-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}
.activity-filter {
  display: grid;
  gap: 4px;
  min-width: 180px;
}
.activity-filter span {
  font-size: 0.75rem;
  color: rgba(203, 213, 225, 0.8);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.activity-filter select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.2);
  background: rgba(15, 23, 42, 0.55);
  color: var(--text);
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.activity-item {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(15, 23, 42, 0.35);
}
.activity-item--unread {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.04);
}
.activity-item--unread .activity-icon::after {
  background: rgba(34, 211, 238, 0.9);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}
.activity-item--muted {
  opacity: 0.55;
}
.activity-item--muted .activity-icon::after {
  background: rgba(148, 163, 184, 0.75);
  box-shadow: none;
}
.activity-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.06);
  flex: 0 0 auto;
  position: relative;
}
.activity-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 10px;
  height: 10px;
  margin: auto;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.75);
  box-shadow: none;
}
.activity-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
}
.activity-line {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}
.activity-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.toggle-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list li {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}
.list li:last-child {
  border-bottom: none;
}

.client-list {
  display: grid;
  gap: 6px;
}

.client-entry {
  background: rgba(15, 23, 42, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "name actions"
    "meta actions";
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
}

.client-entry-name {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  grid-area: name;
}

.client-entry-name:hover {
  text-decoration: underline;
}

.client-entry-actions {
  grid-area: actions;
  justify-self: end;
  align-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.client-entry-actions a {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
}

.client-entry-actions a:visited {
  color: var(--text);
}

.client-entry-actions a:hover {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.24);
}

.client-entry-link-disabled {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  user-select: none;
  opacity: 0.75;
}

.client-entry-meta {
  grid-area: meta;
  margin-top: 2px;
}

@media (max-width: 720px) {
  .client-entry {
    grid-template-columns: 1fr;
    grid-template-areas:
      "name"
      "actions"
      "meta";
    row-gap: 6px;
  }
  .client-entry-actions {
    justify-self: start;
  }
}

.sync-note {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  display: grid;
  place-items: center;
}
.file-icon[data-kind],
.file-icon[data-kind="image"],
.file-icon[data-kind="video"],
.file-icon[data-kind="audio"],
.file-icon[data-kind="pdf"],
.file-icon[data-kind="sheet"],
.file-icon[data-kind="archive"],
.file-icon[data-kind="file"] {
  background: transparent;
}
.file-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text);
}
.file-info span {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.file-actions {
  display: flex;
  gap: 8px;
}
.file-actions {
  flex-wrap: wrap;
}
.file-row .file-actions .btn,
.file-row .file-actions button,
.file-row .file-actions a {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  flex: 0 0 auto;
}

.folder-node {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  margin: 6px 0;
}
.folder-node:last-child {
  margin-bottom: 0;
}
.folder-node summary {
  list-style: none;
  outline: none;
  width: 100%;
}
.folder-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-weight: 600;
  border-radius: 10px;
}
.folder-summary:hover {
  background: rgba(148, 163, 184, 0.08);
}
.folder-summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.folder-caret {
  transition: transform 0.2s ease;
  color: var(--accent);
}
.folder-node[open] .folder-caret {
  transform: rotate(90deg);
}
.folder-meta {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82rem;
  margin-left: auto;
}
.folder-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.folder-actions-inline .btn,
.folder-actions-inline button {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
}
.folder-actions-inline .btn-ghost,
.folder-actions-inline button.btn-ghost {
  background: transparent;
  box-shadow: none;
  border: none;
}
.folder-actions-inline .icon {
  width: 18px;
  height: 18px;
}
.folder-body {
  padding: 0 10px 6px 10px;
}
.folder-body > p:last-child {
  margin-bottom: 0;
}
/* inline folder actions are now in the summary row */
.empty-folder {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 8px 0 0;
}
.file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0px 0px 0px;
}
.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}
.file-row--selectable {
  border-color: rgba(34, 211, 238, 0.25);
}
.file-row--selected {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}
.file-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.file-row .file-info {
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
}
.file-row .file-info strong {
  font-size: 0.95rem;
}
.file-row .file-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  display: grid;
  place-items: center;
}
.file-row .file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.file-row .file-meta span + span::before {
  content: '';
  margin: 0;
}
.file-row .file-actions {
  display: flex;
  gap: 4px;
}
.file-row .file-actions .btn,
.file-row .file-actions button,
.file-row .file-actions a {
  padding: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
}
.file-row .file-actions .btn-ghost,
.file-row .file-actions button.btn-ghost,
.file-row .file-actions a.btn-ghost {
  background: transparent;
  box-shadow: none;
  border: none;
}
.file-row .file-actions .icon {
  width: 20px;
  height: 20px;
}
.file-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.file-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
}
.move-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.move-controls select {
  min-width: 180px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid rgba(226, 232, 240, 0.25);
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
}

[hidden] {
  display: none !important;
}

.category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 18px;
}
.category-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 6px 14px;
  background: rgba(148, 163, 184, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}
.category-btn:hover:not(:disabled) {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.4);
  color: var(--text);
}
.category-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  border-color: rgba(14,165,233,0.5);
  box-shadow: var(--btn-glow);
}
.note-card {
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 14px;
  margin-bottom: 12px;
  background: rgba(15, 23, 42, 0.45);
}
.note-card:last-child {
  margin-bottom: 0;
}
.note-card summary {
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.note-card summary:hover {
  background: rgba(148, 163, 184, 0.08);
}
.note-card summary:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}
.note-summary {
  width: 100%;
}
.note-card[open] summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}
.note-body {
  padding: 14px 16px 16px;
}
.note-meta {
  margin-top: 8px;
  color: var(--text-muted);
}
.note-actions {
  margin-top: 10px;
}

.folder-node[data-depth="0"] { background: rgba(15, 23, 42, 0.5); border: 1px solid rgba(59, 130, 246, 0.25); }
.folder-node[data-depth="1"] { background: rgba(26, 39, 70, 0.5); }
.folder-node[data-depth="2"] { background: rgba(34, 44, 90, 0.48); }
.folder-node[data-depth="3"] { background: rgba(43, 53, 110, 0.45); }
.tab-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.tab-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease, border 0.2s ease;
}
.tab-btn:hover:not(:disabled):not(.active) {
  background: rgba(148, 163, 184, 0.22);
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.35);
}
.tab-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: rgba(148, 163, 184, 0.08);
  color: rgba(203, 213, 245, 0.55);
  box-shadow: none;
}
.tab-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #0f172a;
  border-color: rgba(14,165,233,0.4);
  box-shadow: var(--btn-glow);
}
.tab-panel {
  margin-bottom: 18px;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-modal[hidden] {
  display: none;
}
.preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
}
.preview-modal__panel {
  position: relative;
  width: min(900px, 90%);
  max-height: 90vh;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.preview-modal__body {
  overflow: auto;
  max-height: 70vh;
}
.preview-placeholder {
  color: var(--text-muted);
}
.preview-media {
  width: 100%;
  height: auto;
  max-height: 65vh;
  border-radius: 12px;
  object-fit: contain;
  background: #0f172a;
}
.preview-audio {
  width: 100%;
}
.preview-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

@media (max-width: 460px) {
  :root { --panel-gutter: 18px; }
  body { font-size: 0.95rem; }
  .container { width: 100%; padding: 16px; }
  #notesHero .hero-title-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
  }
  #notesHero .hero-after-title { min-width: 0; }
  #notesHero .hero-divider { display: none; }
  #notesHero .hero-client-select { min-width: 0; max-width: 100%; }
  #notesHero .hero-select-trigger { max-width: 100%; }
  #notesHero .hero-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  #notesHero .hero-title-line .manual-sync-inline { justify-self: end; }
  #notesHero .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #notesHero .hero-actions > * { min-width: 0; }
  #notesHero .hero-actions .pill {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #filesHero .hero-title-line {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
  }
  #filesHero .hero-after-title {
    min-width: 0;
  }
  #filesHero .hero-divider {
    display: none;
  }
  #filesHero .hero-client-select {
    min-width: 0;
    max-width: 100%;
  }
  #filesHero .hero-select-trigger {
    max-width: 100%;
  }
  #filesHero .hero-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
  #filesHero .hero-title-line .manual-sync-inline {
    justify-self: end;
  }
  #filesHero .hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #filesHero .hero-actions > * {
    min-width: 0;
  }
  #filesHero .hero-actions .pill {
    width: 100%;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .site-header .container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .header-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
  }
  .brand {
    grid-column: 2;
    justify-self: center;
  }
  .js .nav-toggle {
    display: inline-flex;
    grid-column: 3;
    justify-self: end;
  }
  .nav {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 16px;
    justify-items: stretch;
  }
  .nav a {
    margin-left: 0;
    text-align: center;
    padding: 10px 12px;
    font-size: 0.95rem;
  }
  .nav-activity { justify-content: center; }
  .js .site-header:not([data-nav-open="true"]) .nav { display: none; }
  .card,
  .upload-panel {
    padding: 18px;
  }
  .page-hero {
    flex-direction: column;
    align-items: flex-start;
  }
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .file-row .file-actions {
    width: 100%;
    justify-content: space-evenly;
    gap: 0;
  }
  .file-row .file-actions .icon-only {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .tab-buttons {
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  .tab-buttons-inline {
    width: 100%;
    flex-direction: column;
    gap: 8px;
  }
  .tab-buttons-inline .tab-btn {
    width: 100%;
  }
  #fileBrowserPanel .tab-buttons-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #fileBrowserPanel .tab-buttons-inline .tab-btn:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  #notesBrowserPanel .tab-buttons-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #notesBrowserPanel .category-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  #notesBrowserPanel .category-btn {
    width: 100%;
  }
  #notesBrowserPanel .category-btn:first-child {
    grid-column: 1 / -1;
  }
  .file-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 6px 10px;
  }
  .file-main {
    width: 100%;
  }
  .file-row .file-icon {
    width: 24px;
    height: 24px;
  }
  .file-row .file-info {
    width: 100%;
  }
  .file-row .file-info strong {
    line-height: 1.05;
  }
  .file-row .file-meta {
    line-height: 1.1;
    margin-top: 4px;
  }
  .file-row .file-actions {
    position: relative;
    padding-top: 2px;
  }
  .file-row .file-actions::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: rgba(148, 163, 184, 0.2);
  }
  .folder-summary {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 1px;
    padding: 7px 12px 4px;
    padding-left: 12px !important;
  }
  .folder-caret {
    grid-column: 1;
    grid-row: 1;
  }
  .folder-name {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .folder-actions-inline {
    grid-column: 3;
    grid-row: 1 / span 2;
    margin-left: 0;
    align-self: center;
    gap: 4px;
  }
  .folder-meta {
    grid-column: 2;
    grid-row: 2;
    margin-left: 0;
    white-space: nowrap;
    line-height: 1.1;
  }
  .folder-caret {
    grid-row: 1 / span 2;
    align-self: center;
  }
  .folder-actions-inline .btn,
  .folder-actions-inline button {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .folder-actions-inline .icon-img {
    width: 28px;
    height: 28px;
  }
  .manual-sync-inline {
    white-space: nowrap;
  }
  .hero-title-line .manual-sync-inline {
    padding: 6px 10px;
    font-size: 0.85rem;
    line-height: 1.1;
  }
  .tab-btn {
    width: 100%;
    flex: none;
    text-align: center;
  }
  .category-bar {
    width: 100%;
    gap: 8px;
  }
  .category-btn {
    flex: 1 1 auto;
    text-align: center;
  }
  .note-card summary {
    font-size: 0.95rem;
    padding: 10px 12px;
  }
  .note-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .note-actions .btn,
  .note-actions button,
  .form button,
  .form .btn {
    width: 100%;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 380px) {
  :root { --panel-gutter: 16px; }
  body { font-size: 0.9rem; }
  .container { padding: 12px; }
  .site-header .container { gap: 6px; }
  .nav {
    flex-wrap: wrap;
    gap: 4px;
  }
  .nav a {
    flex: 1 1 48%;
    font-size: 0.85rem;
  }
  .tab-buttons { gap: 6px; }
  .category-bar {
    flex-direction: column;
  }
  .card,
  .upload-panel {
    padding: 16px;
  }
  .note-card summary {
    font-size: 0.9rem;
  }
  .toolbar button {
    width: 100%;
  }
}
