/* =========================================================================
   Cloudboard · UI based on DESIGN.md
   Anthropic-inspired: warm parchment canvas · terracotta accent · serif voice
   ========================================================================= */

:root {
  /* ---------- Surface ---------- */
  --bg: #f5f4ed;            /* Parchment */
  --bg-elev: #faf9f5;       /* Ivory */
  --card: #faf9f5;          /* Ivory */
  --sand: #e8e6dc;          /* Warm Sand — secondary button bg */
  --white: #ffffff;

  /* ---------- Text ---------- */
  --fg: #141413;            /* Anthropic Near Black */
  --fg-dim: #4d4c48;        /* Charcoal Warm */
  --muted: #5e5d59;         /* Olive Gray */
  --muted-2: #87867f;       /* Stone Gray */
  --dim: #3d3d3a;           /* Dark Warm */

  /* ---------- Border / Ring ---------- */
  --border: #f0eee6;        /* Border Cream */
  --border-strong: #e8e6dc; /* Border Warm */
  --ring: #d1cfc5;          /* Ring Warm */
  --ring-deep: #c2c0b6;

  /* ---------- Brand ---------- */
  --accent: #c96442;        /* Terracotta */
  --accent-hover: #b35433;
  --accent-soft: rgba(201, 100, 66, 0.10);
  --coral: #d97757;         /* Coral — light-surface links */
  --danger: #b53333;        /* Error Crimson */
  --focus: #3898ec;         /* Focus Blue — ONLY cool color, accessibility */

  /* ---------- Elevation ---------- */
  --ring-shadow: 0 0 0 1px var(--ring);
  --ring-shadow-deep: 0 0 0 1px var(--ring-deep);
  --whisper: 0 4px 24px rgba(20, 20, 19, 0.05);
  --lift: 0 8px 32px rgba(20, 20, 19, 0.08);

  /* ---------- Radius ---------- */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-max: 32px;

  /* ---------- Type ---------- */
  --font-serif: 'Source Serif 4', 'Source Serif Pro', 'Noto Serif SC', Georgia, 'Songti SC', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', Arial, sans-serif;
  --font-mono: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;

  color-scheme: light;
}

/* Dark — follows system, unless data-theme=light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141413;          /* Deep Dark */
    --bg-elev: #30302e;     /* Dark Surface */
    --card: #30302e;
    --sand: #30302e;
    --white: #30302e;

    --fg: #faf9f5;          /* Ivory */
    --fg-dim: #b0aea5;      /* Warm Silver */
    --muted: #87867f;       /* Stone Gray */
    --muted-2: #5e5d59;
    --dim: #b0aea5;

    --border: #30302e;      /* Border Dark */
    --border-strong: #4d4c48;
    --ring: #4d4c48;
    --ring-deep: #5e5d59;

    --accent: #d97757;      /* Coral on dark */
    --accent-hover: #e08863;
    --accent-soft: rgba(217, 119, 87, 0.14);

    --whisper: 0 4px 24px rgba(0, 0, 0, 0.4);
    --lift: 0 8px 32px rgba(0, 0, 0, 0.5);

    color-scheme: dark;
  }
}

/* Explicit dark — wins over system */
:root[data-theme="dark"] {
  --bg: #141413;
  --bg-elev: #30302e;
  --card: #30302e;
  --sand: #30302e;
  --white: #30302e;

  --fg: #faf9f5;
  --fg-dim: #b0aea5;
  --muted: #87867f;
  --muted-2: #5e5d59;
  --dim: #b0aea5;

  --border: #30302e;
  --border-strong: #4d4c48;
  --ring: #4d4c48;
  --ring-deep: #5e5d59;

  --accent: #d97757;
  --accent-hover: #e08863;
  --accent-soft: rgba(217, 119, 87, 0.14);

  --whisper: 0 4px 24px rgba(0, 0, 0, 0.4);
  --lift: 0 8px 32px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ---------- Reset / Base ---------- */

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.muted { color: var(--muted); }

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--fg);
  margin: 0;
}

/* =========================================================================
   Login View
   ========================================================================= */

.login-view {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background: var(--bg);
}

.login-card {
  background: var(--card);
  padding: 40px 36px;
  border-radius: var(--r-lg);
  box-shadow: var(--whisper), 0 0 0 1px var(--border);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  font-size: 44px;
  line-height: 1;
  text-align: center;
  margin-bottom: 12px;
}
.login-card h1 {
  font-size: 32px;
  line-height: 1.1;
  text-align: center;
  margin: 0 0 8px;
}
.login-card p {
  margin: 0 0 24px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.login-card input {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  margin-bottom: 12px;
  transition: box-shadow .2s;
}
.login-card input::placeholder { color: var(--muted-2); }
.login-card input:focus { box-shadow: 0 0 0 2px var(--focus); }

.login-card button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #faf9f5;
  border: 0;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--accent);
  transition: background .2s, box-shadow .2s;
}
.login-card button[type="submit"]:hover { background: var(--accent-hover); }
.login-card button[type="submit"]:active { transform: translateY(1px); }

.login-public-link {
  display: block;
  margin-top: 14px;
  text-align: center;
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
}
.login-public-link:hover { color: var(--accent-hover); }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
}

/* Theme toggle (login corner + top bar) */
.theme-corner {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card);
  color: var(--fg);
  border: 0;
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 0 0 1px var(--border-strong);
  transition: box-shadow .2s, background .2s;
}
.theme-corner:hover { box-shadow: 0 0 0 1px var(--ring-deep); background: var(--sand); }

/* =========================================================================
   App View
   ========================================================================= */

.app-view {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 120px max(16px, env(safe-area-inset-right));
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 12px 0;
  z-index: 10;
  border-bottom: 1px solid transparent;
}

.brand {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 2px 0;
}

/* Input fields on toolbar */
.search, .device-input {
  padding: 7px 12px;
  background: var(--bg-elev);
  color: var(--fg);
  border: 0;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  font-size: 14px;
  transition: box-shadow .15s;
}
.search::placeholder, .device-input::placeholder { color: var(--muted-2); }
.search { flex: 1; min-width: 140px; }
.device-input { width: 120px; }
.search:focus, .device-input:focus { box-shadow: 0 0 0 2px var(--focus); }

/* Warm Sand icon button */
.icon-btn {
  padding: 7px 12px;
  background: var(--sand);
  color: var(--fg-dim);
  border: 0;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px var(--ring);
  font-size: 14px;
  line-height: 1.2;
  transition: box-shadow .15s, background .15s, color .15s;
}
.icon-btn:hover {
  background: var(--bg-elev);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--ring-deep);
}
.icon-btn:active { box-shadow: inset 0 0 0 1px rgba(20, 20, 19, 0.15); }
.inbox-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.inbox-btn.has-count {
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #faf9f5;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* =========================================================================
   Input Card
   ========================================================================= */

.input-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 0 0 1px var(--border);
}

.note-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  transition: box-shadow .15s;
}
.note-input::placeholder { color: var(--muted-2); }
.note-input:focus { box-shadow: 0 0 0 2px var(--focus); }

#text-input {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  resize: vertical;
  font-size: 15px;
  line-height: 1.6;
  transition: box-shadow .15s;
}
#text-input::placeholder { color: var(--muted-2); }
#text-input:focus { box-shadow: 0 0 0 2px var(--focus); }

.actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.hint {
  flex: 1;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Buttons */
.btn-primary {
  padding: 9px 20px;
  background: var(--accent);
  color: #faf9f5;
  border: 0;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--accent);
  transition: background .15s, box-shadow .15s;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 0 1px var(--accent-hover); }
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  padding: 9px 18px;
  background: var(--sand);
  color: var(--fg-dim);
  border: 0;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 0 0 1px var(--ring);
  transition: background .15s, box-shadow .15s;
}
.btn-secondary:hover { background: var(--bg-elev); box-shadow: 0 0 0 1px var(--ring-deep); }

/* =========================================================================
   Status Bar
   ========================================================================= */

.status-bar {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  min-height: 18px;
  flex-wrap: wrap;
  letter-spacing: 0.12px;
}
.status-bar.busy::before {
  content: '';
  width: 10px; height: 10px;
  border: 1.5px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  align-self: center;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   Items List
   ========================================================================= */

.items {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.item {
  background: var(--card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--border);
  transition: box-shadow .2s, transform .2s;
}
.item:hover { box-shadow: 0 0 0 1px var(--border-strong), var(--whisper); }
.item.pinned {
  box-shadow: 0 0 0 1px var(--border), inset 3px 0 0 var(--accent);
}
.item.pinned:hover { box-shadow: 0 0 0 1px var(--border-strong), inset 3px 0 0 var(--accent), var(--whisper); }
.item.new-flash { animation: flash 1.4s ease-out; }
@keyframes flash {
  0% { background: var(--accent-soft); }
  100% { background: var(--card); }
}

.item-head {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  align-items: center;
  letter-spacing: 0.12px;
}
.item-time { font-variant-numeric: tabular-nums; }
.item-device::before { content: '·  '; color: var(--muted-2); }
.item-size { margin-left: auto; font-variant-numeric: tabular-nums; }
.item-type-badge {
  font-size: 10.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-weight: 500;
}

.item-body {
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
}
.item-note {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 4px 9px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  word-break: break-word;
}
.item-body .item-text {
  margin: 0;
  font-family: var(--font-mono);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 280px;
  overflow: auto;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: -0.32px;
  color: var(--fg);
}
.item-body .item-text.link-like {
  font-family: var(--font-sans);
  color: var(--accent);
  word-break: break-all;
}
.item-body img {
  max-width: 100%;
  max-height: 340px;
  border-radius: var(--r);
  display: block;
  cursor: zoom-in;
  background: var(--bg);
}
.item-body .filename {
  margin-top: 10px;
  font-size: 14px;
  word-break: break-all;
  color: var(--fg-dim);
}
.item-body .file-row {
  display: flex;
  gap: 16px;
  align-items: center;
}
.item-body .file-icon {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
}

.item-actions {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  justify-content: flex-end;
}
.action-btn {
  padding: 6px 12px;
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
  font-size: 13px;
  font-weight: 400;
}
.action-btn:hover { background: var(--sand); color: var(--fg); }
.action-btn.danger:hover { background: var(--danger); color: #faf9f5; }
.action-btn.active { color: var(--accent); }

/* ---------- Edit Mode ---------- */

.item.editing { box-shadow: 0 0 0 2px var(--accent); }
.edit-note-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  transition: box-shadow .15s;
}
.edit-note-input::placeholder { color: var(--muted-2); }
.edit-note-input:focus { box-shadow: 0 0 0 2px var(--focus); }
.edit-textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: -0.32px;
  transition: box-shadow .15s;
}
.edit-textarea:focus { box-shadow: 0 0 0 2px var(--focus); }
.edit-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.edit-hint {
  flex: 1;
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
}
.item-edited {
  font-size: 11px;
  color: var(--muted-2);
  font-style: italic;
  letter-spacing: 0.12px;
}

/* =========================================================================
   Empty State
   ========================================================================= */

.empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 1.5;
}

/* =========================================================================
   Toast
   ========================================================================= */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--fg);
  color: var(--bg);
  padding: 10px 20px;
  border-radius: var(--r-xl);
  font-size: 13px;
  letter-spacing: 0.12px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 400;
  white-space: nowrap;
  box-shadow: var(--lift);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* =========================================================================
   Image Preview Overlay
   ========================================================================= */

.preview {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: zoom-out;
  padding: 40px 20px;
}
.preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r);
}
.preview-close {
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 28px;
  line-height: 1;
  color: #faf9f5;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  transition: background .15s;
}
.preview-close:hover { background: rgba(250, 249, 245, 0.1); }

/* =========================================================================
   Modal (Share)
   ========================================================================= */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 19, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 280;
  padding: 20px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  background: var(--card);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--lift), 0 0 0 1px var(--border-strong);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}
.modal-card-wide { max-width: 720px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.modal-close {
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--sand); color: var(--fg); }
.modal-body { padding: 20px 22px; overflow: auto; }
.modal-actions {
  padding: 14px 22px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--bg);
}

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 500;
}

/* Segmented control */
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--bg);
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border);
}
.seg button {
  flex: 1;
  min-width: 60px;
  padding: 8px 12px;
  background: transparent;
  color: var(--fg-dim);
  border: 0;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--fg); }
.seg button.active {
  background: var(--card);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--ring), var(--whisper);
}

.share-url-row {
  display: flex;
  gap: 8px;
}
.share-url-row input {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg);
  color: var(--fg);
  border: 0;
  border-radius: var(--r-sm);
  box-shadow: 0 0 0 1px var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: -0.32px;
  outline: none;
  min-width: 0;
}
.share-url-row input:focus { box-shadow: 0 0 0 2px var(--focus); }
.share-hint {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.12px;
  color: var(--muted);
}

/* =========================================================================
   Anonymous Submissions
   ========================================================================= */

.submission-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.submission-empty {
  padding: 40px 16px;
  font-size: 16px;
}
.submission-item {
  background: var(--bg);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.submission-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 12px;
  letter-spacing: 0.12px;
}
.submission-note-input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--card);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  font-size: 14px;
  line-height: 1.4;
  transition: box-shadow .15s;
}
.submission-note-input::placeholder { color: var(--muted-2); }
.submission-note-input:focus { box-shadow: 0 0 0 2px var(--focus); }
.submission-textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  background: var(--card);
  color: var(--fg);
  border: 0;
  border-radius: var(--r);
  box-shadow: 0 0 0 1px var(--border-strong);
  outline: none;
  resize: vertical;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
  transition: box-shadow .15s;
}
.submission-textarea:focus { box-shadow: 0 0 0 2px var(--focus); }
.submission-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 12px;
}
.submission-spacer { flex: 1; }

/* =========================================================================
   Drop Overlay
   ========================================================================= */

.drop-overlay {
  position: fixed;
  inset: 16px;
  background: rgba(201, 100, 66, 0.1);
  border: 2px dashed var(--accent);
  border-radius: var(--r-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  pointer-events: none;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.drop-msg {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--accent);
  background: var(--card);
  padding: 24px 40px;
  border-radius: var(--r-lg);
  box-shadow: var(--lift), 0 0 0 1px var(--border-strong);
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 640px) {
  .brand-text { display: none; }
  .brand { font-size: 24px; }
  .device-input { width: 88px; }
  .top-bar { gap: 6px; padding: 10px 0; }
  .app-view { padding: 8px 12px 120px; }
  .login-card { padding: 32px 24px; }
  .login-card h1 { font-size: 28px; }
  .input-card { padding: 12px; }
  .item-body { padding: 14px; }
  .item-head { padding: 8px 14px; }
  .item-actions { padding: 6px 10px; }
  .modal-card-wide { max-width: 100%; }
  .submission-spacer { display: none; }
}

@media (max-width: 479px) {
  .login-card h1 { font-size: 24px; }
  .action-btn { padding: 6px 10px; font-size: 12.5px; }
  .seg button { min-width: 48px; padding: 7px 8px; font-size: 12px; }
}
