/* Local Share — app.css
   Extracted from index.html for maintainability.
   Served with cache-busting query param from server.
*/


/* ── System font stack ─────────────────────────────────────────────────────── */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --sz-base: 14px;
  --sz-sm:   12px;
  --sz-xs:   11px;

  /* Brand colours — small, purposeful */
  --accent:      #0e7f5c;
  --accent-bg:   #e8f7f1;
  --accent-ring: #0e7f5c;
  --purple:      #4f46e5;
  --purple-bg:   #eef2ff;
  --danger:      #dc2626;
  --danger-bg:   #fef2f2;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
}

/* ── Dark theme ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #111118;
  --bg2:          #18181f;
  --surface:      #1e1f2d;
  --surface2:     #272839;
  --border:       #32334a;
  --border2:      #41425e;
  --text:         #f0f0f8;
  --text2:        #9496b8;
  --text3:        #5a5c78;
  --input-bg:     #0d0e1a;
  --shadow:       0 1px 3px rgba(0,0,0,.4);
  --shadow-md:    0 4px 16px rgba(0,0,0,.5);
  --bubble-out:   #4f46e5;
  --bubble-in:    #272839;
  --bubble-in-b:  #32334a;
  --accent-bg:    rgba(14,127,92,.15);
  --purple-bg:    rgba(79,70,229,.15);
}

/* ── Light theme ─────────────────────────────────────────────────────────────── */
[data-theme="light"] {
  --bg:           #f5f5f5;
  --bg2:          #ebebeb;
  --surface:      #ffffff;
  --surface2:     #f8f8f8;
  --border:       #e0e0e0;
  --border2:      #c8c8c8;
  --text:         #111111;
  --text2:        #555555;
  --text3:        #999999;
  --input-bg:     #ffffff;
  --shadow:       0 1px 3px rgba(0,0,0,.1);
  --shadow-md:    0 4px 16px rgba(0,0,0,.15);
  --bubble-out:   #4f46e5;
  --bubble-in:    #ffffff;
  --bubble-in-b:  #e0e0e0;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; height: 100dvh; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--sz-base);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  flex-shrink: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 14px;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 50;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { width: 16px; height: 16px; }
.logo-w  { color: var(--text); }
.logo-sep { color: var(--text3); font-weight: 400; margin: 0 1px; }
.logo-s  { color: var(--accent); }
.logo-sub { display: none; }
.logo-wordmark { display: flex; align-items: baseline; gap: 1px; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.my-device-badge {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: var(--sz-sm);
}
.dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  animation: pulse 2.5s ease infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

#name-input {
  background: none; border: none; outline: none;
  font-family: var(--font); font-size: var(--sz-sm); font-weight: 500;
  color: var(--text); width: 110px; cursor: text;
}

/* Standard icon button */
.icon-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.icon-btn:hover { background: var(--bg2); border-color: var(--border2); }

/* ── Main ────────────────────────────────────────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }

/* ── Toolbar ─────────────────────────────────────────────────────────────────── */
.toolbar {
  flex-shrink: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  padding: 6px 14px;
  gap: 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
}

.toolbar-label {
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--text2);
}

/* ── Standard select-style dropdown trigger ────────────────────────────────── */
.recipient-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--input-bg);
  font-family: var(--font);
  font-size: var(--sz-sm);
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
  min-width: 140px;
  white-space: nowrap;
  user-select: none;
}
.recipient-btn:hover { border-color: var(--accent-ring); }
.recipient-btn:focus,
.recipient-btn.open  { border-color: var(--accent-ring); outline: none;
                        box-shadow: 0 0 0 2px rgba(14,127,92,.18); }
.rdot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.rdot.purple { background: var(--purple); }
.rarrow { font-size: 13px; color: var(--text2); margin-left: auto; transition: transform .15s; font-weight: bold; }
.recipient-btn.open .rarrow { transform: rotate(180deg); }
.count-badge {
  font-size: var(--sz-xs); font-family: var(--font-mono);
  background: var(--accent-bg); color: var(--accent);
  border-radius: 10px; padding: 0 5px; font-weight: 600;
}

/* Dropdown panel — standard list appearance */
.device-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 14px;
  min-width: 240px;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 200;
  overflow: hidden;
  display: none;
}
.device-dropdown.open { display: block; }
.dd-section { padding: 4px; }
.dd-section + .dd-section { border-top: 1px solid var(--border); }
.dd-label {
  font-size: var(--sz-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text3); padding: 5px 10px 4px;
}
.dd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .1s;
}
.dd-item:hover { background: var(--bg2); }
.dd-item.selected { background: var(--accent-bg); }
.dd-item.selected .dd-name { color: var(--accent); font-weight: 600; }
.dd-item.selected-purple { background: var(--purple-bg); }
.dd-item.selected-purple .dd-name { color: var(--purple); font-weight: 600; }
.dd-item.no-cursor { cursor: default; }
.dd-item.no-cursor:hover { background: transparent; }
.dd-avatar {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  background: var(--surface2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.dd-info { flex: 1; min-width: 0; }
.dd-name { font-size: var(--sz-sm); font-weight: 500;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-sub  { font-size: var(--sz-xs); color: var(--text3);
           font-family: var(--font-mono); margin-top: 1px; }
.you-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 4px; background: var(--purple-bg); color: var(--purple);
  border: 1px solid rgba(79,70,229,.2); flex-shrink: 0;
}
.dd-refresh-btn {
  width: 100%; padding: 7px 10px;
  border: none; border-top: 1px solid var(--border);
  background: none; color: var(--accent);
  font-family: var(--font); font-size: var(--sz-sm);
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 6px;
  transition: background .12s;
}
.dd-refresh-btn:hover { background: var(--accent-bg); }
.dd-refresh-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toolbar center / right */
.toolbar-center {
  display: flex; align-items: center; gap: 6px;
  flex: 1; justify-content: center;
}
.toolbar-right {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

/* Standard toolbar buttons */
.ping-btn, .reset-btn {
  height: 26px; padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--surface2);
  font-family: var(--font);
  font-size: var(--sz-sm);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.ping-btn { color: var(--accent); border-color: var(--accent); background: var(--accent-bg); font-weight: 500; }
.ping-btn:hover  { background: var(--accent-bg); filter: brightness(.93); }
.ping-btn:active { transform: scale(.95); }
.ping-btn.fired  { animation: ping-flash .4s ease; }
@keyframes ping-flash { 0%,100%{opacity:1} 50%{opacity:.45;transform:scale(.9)} }
.reset-btn { color: var(--text2); }
.reset-btn:hover { border-color: var(--danger); color: var(--danger); }

/* Status */
.status-dot { width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; display: inline-block; }
.status-dot.connected    { background: var(--accent); }
.status-dot.disconnected { background: var(--danger); }
#status-text { font-size: var(--sz-xs); color: var(--text2); font-family: var(--font-mono); }
#my-id-label { font-size: var(--sz-xs); color: var(--text3); font-family: var(--font-mono); }

.overlay { display: none; position: fixed; inset: 0; z-index: 100; }
.overlay.open { display: block; }

/* ── Messages ────────────────────────────────────────────────────────────────── */
.messages {
  flex: 1; overflow-y: auto; padding: 14px 14px 8px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0; scroll-behavior: smooth;
  background: var(--bg);
}

/* Empty state / radar */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; text-align: center; padding: 32px;
  position: relative; overflow: hidden;
}
.empty-state::before {
  content: ''; position: absolute; inset: 0;
  background-image: repeating-conic-gradient(
    rgba(14,127,92,.03) 0deg, transparent 1deg, transparent 29deg, rgba(14,127,92,.03) 30deg);
  pointer-events: none;
}
.radar-wrap { position: relative; width: 160px; height: 160px;
              display: flex; align-items: center; justify-content: center; }
.radar-ring { position: absolute; border-radius: 50%;
              border: 1.5px solid var(--accent); animation: radar-pulse 3s ease-out infinite; opacity: 0; }
.radar-ring.r1 { width: 64px;  height: 64px;  animation-delay: 0s; }
.radar-ring.r2 { width: 96px;  height: 96px;  animation-delay: .75s; }
.radar-ring.r3 { width: 132px; height: 132px; animation-delay: 1.5s; }
.radar-ring.r4 { width: 168px; height: 168px; animation-delay: 2.25s; }
@keyframes radar-pulse { 0%{transform:scale(.4);opacity:0} 10%{opacity:.45} 100%{transform:scale(1);opacity:0} }
.radar-spinner { position: absolute; width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: var(--accent);
  border-right-color: rgba(14,127,92,.2); animation: spin 2.4s linear infinite; }
.radar-center { position: relative; z-index: 2; width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.radar-center svg { width: 20px; height: 20px; }
.radar-ring.flash { animation: radar-flash .5s ease-out forwards; }
@keyframes radar-flash { 0%{opacity:.8;border-color:var(--accent);transform:scale(.3)} 100%{opacity:0;transform:scale(1)} }
.empty-text { font-size: var(--sz-base); color: var(--text2); line-height: 1.8; position: relative; z-index: 1; }

/* Bubbles */
.msg { max-width: 70%; animation: slideUp .18s ease; }
@keyframes slideUp { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.msg.self  { align-self: flex-end; }
.msg.other { align-self: flex-start; }
.msg-meta { font-size: var(--sz-xs); font-family: var(--font-mono);
            color: var(--text3); margin-bottom: 3px; display: flex; gap: 6px; }
.msg.self .msg-meta { flex-direction: row-reverse; }
.msg-bubble { padding: 9px 13px; border-radius: var(--radius);
              font-size: var(--sz-base); line-height: 1.55;
              word-break: break-word; box-shadow: var(--shadow); }
.msg.self  .msg-bubble { background: var(--bubble-out); color: #fff; border-bottom-right-radius: 2px; }
.msg.other .msg-bubble { background: var(--bubble-in); border: 1px solid var(--bubble-in-b);
                          color: var(--text); border-bottom-left-radius: 2px; }

/* Type badge */
.msg-type-badge {
  font-size: 9px; font-family: var(--font-mono); font-weight: 700;
  padding: 1px 5px; border-radius: 3px; margin-bottom: 4px;
  display: inline-block; text-transform: uppercase; letter-spacing: .5px;
}
.badge-text { background: var(--accent-bg); color: var(--accent); }
.badge-link { background: var(--purple-bg); color: var(--purple); }
.badge-file { background: var(--danger-bg); color: var(--danger); }

/* Links */
.msg.self  .msg-link a         { color: #c7c3ff; text-decoration: underline; word-break: break-all; }
.msg.self  .msg-link a:visited { color: #c7c3ff; }
.msg.other .msg-link a         { color: var(--purple); text-decoration: underline; word-break: break-all; }
.msg.other .msg-link a:visited { color: var(--purple); }
.msg-link.blocked a            { color: var(--danger); pointer-events: none; text-decoration: line-through; opacity: .6; }

/* File card */
.file-card { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--danger-bg); border: 1px solid rgba(220,38,38,.2);
  border-radius: var(--radius-sm); text-decoration: none; color: var(--text); transition: filter .12s; }
.file-card:hover { filter: brightness(.95); }
.file-icon { font-size: 18px; }
.file-name { font-size: var(--sz-sm); font-weight: 600; }
.file-size { font-size: var(--sz-xs); color: var(--text3); font-family: var(--font-mono); }

/* Receipt */
.msg-receipt { display: flex; align-items: center; justify-content: flex-end;
  gap: 4px; margin-top: 3px; font-size: var(--sz-xs);
  font-family: var(--font-mono); color: var(--text3); min-height: 14px; }
.receipt-icon { display: inline-flex; align-items: center; gap: 1px; }
.receipt-icon .tick { width: 8px; height: 8px; }
.receipt-icon .tick path { stroke: var(--text3); stroke-width: 2; fill: none;
  stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.msg-receipt.read .tick path    { stroke: var(--accent); }
.msg-receipt.read .receipt-label { color: var(--accent); }
.msg-receipt.partial-read .receipt-icon .tick:last-child path { stroke: var(--accent); }
.msg-receipt.no-recipients .receipt-label { font-style: italic; }
.sys-msg { text-align: center; font-size: var(--sz-xs);
           font-family: var(--font-mono); color: var(--text3); padding: 2px 0; }

/* ── Input area ──────────────────────────────────────────────────────────────── */
.input-area {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* Tab row — standard pill tabs */
.input-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}
.tab-btn {
  flex: 1; height: 32px;
  border: none;
  border-right: 1px solid var(--border2);
  background: transparent;
  color: var(--text2);
  font-family: var(--font); font-size: var(--sz-sm); font-weight: 500;
  cursor: pointer; transition: all .12s;
}
.tab-btn:last-child { border-right: none; }
.tab-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}
.tab-btn:not(.active):hover {
  background: var(--surface2);
  color: var(--text);
}

.tab-panel { display: none; height: 60px; }
.tab-panel.active { display: flex; gap: 8px; align-items: center; }

/* Standard text field */
.input-box {
  flex: 1; height: 60px;
  background: var(--input-bg);
  border: 2px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  color: var(--text);
  font-family: var(--font); font-size: var(--sz-base);
  outline: none; resize: none; line-height: 1.5;
  transition: border-color .12s, box-shadow .12s;
}
.input-box:focus   { border-color: var(--accent-ring);
                      box-shadow: 0 0 0 2px rgba(14,127,92,.18); }
.input-box.invalid { border-color: var(--danger); }
.input-box::placeholder { color: var(--text3); }

/* Standard submit button */
.send-btn {
  min-width: max(44px, 10vw); height: 44px;
  border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: #fff;
  font-family: var(--font); font-size: 16px; font-weight: 600;
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  align-self: center;
  transition: background .12s, transform .1s;
}
.send-btn:hover  { background: #0a6648; }
.send-btn:active { transform: scale(.96); }

/* File upload */
.file-upload-zone {
  flex: 1; height: 60px;
  border: 1px dashed var(--border2); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text2); font-size: var(--sz-sm);
  transition: all .12s; position: relative;
}
.file-upload-zone:hover    { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.file-upload-zone.drag-over { border-color: var(--accent); background: var(--accent-bg); }
.file-upload-zone input    { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

.upload-progress { display: none; align-items: center; gap: 8px;
  font-size: var(--sz-xs); font-family: var(--font-mono); color: var(--accent); }
.upload-progress.show { display: flex; }
.progress-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .2s; }

/* ── Primary footer ───────────────────────────────────────────────────────────── */
footer.footer-main {
  flex-shrink: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 6px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px;
  font-size: var(--sz-xs);
  font-family: var(--font-mono);
  color: var(--text3);
}
.footer-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-sep  { opacity: .4; }
footer.footer-main a { color: var(--text3); text-decoration: none; }
footer.footer-main a:hover { color: var(--accent); text-decoration: underline; }
.footer-link-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-family: var(--font-mono); font-size: var(--sz-xs);
  padding: 0; text-decoration: underline; text-underline-offset: 2px;
}
.footer-link-btn:hover { color: var(--accent); }
.donate-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid rgba(220,38,38,.25); background: var(--danger-bg);
  color: var(--danger) !important; font-family: var(--font-mono);
  font-size: var(--sz-xs); text-decoration: none; transition: filter .12s;
}
.donate-btn:hover { filter: brightness(.9); }

/* ── Ad footer ────────────────────────────────────────────────────────────────── */
footer.footer-ad {
  flex-shrink: 0;
  min-height: 54px;
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  font-size: var(--sz-xs);
  color: var(--text3);
  gap: 10px;
  position: relative;
}
.ad-label {
  position: absolute; top: 4px; left: 8px;
  font-size: 9px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text3);
  font-family: var(--font-mono);
}
.ad-slot {
  width: 100%; max-width: 728px;
  min-height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text3); font-size: var(--sz-xs);
  font-family: var(--font);
  background: var(--surface2);
  text-align: center; padding: 6px;
}

/* ── LAN trust warning banner ─────────────────────────────────────────────────── */
.lan-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 14px;
  background: #7c4a00;
  color: #ffd580;
  font-size: var(--sz-xs);
  font-family: var(--font);
  border-bottom: 1px solid #a36000;
  flex-shrink: 0;
}
[data-theme="light"] .lan-warning {
  background: #fff8e1;
  color: #7c4a00;
  border-bottom-color: #f0c060;
}
.lan-warning-text { flex: 1; line-height: 1.4; }
.lan-warning-dismiss {
  background: none; border: none;
  color: inherit; cursor: pointer;
  font-size: 14px; padding: 0 2px;
  opacity: .7; flex-shrink: 0;
  transition: opacity .12s;
}
.lan-warning-dismiss:hover { opacity: 1; }

/* ── Toast ───────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: var(--surface); border: 1px solid var(--border2);
  color: var(--text); font-size: var(--sz-sm); font-family: var(--font);
  padding: 7px 14px; border-radius: 20px; z-index: 999;
  opacity: 0; transition: opacity .25s; pointer-events: none; white-space: nowrap;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-backdrop { display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px); z-index: 900; }
.modal-backdrop.open { display: block; }
.modal { position: fixed; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(.97);
  width: min(640px,94vw); max-height: 80dvh;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); z-index: 950;
  display: none; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-md); opacity: 0;
  transition: transform .2s, opacity .2s; }
.modal[open] { display: flex; transform: translate(-50%,-50%) scale(1); opacity: 1; }
.modal-header { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-header h2 { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close { width: 26px; height: 26px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text2); cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center; transition: all .12s; }
.modal-close:hover { border-color: var(--danger); color: var(--danger); }
.modal-body { overflow-y: auto; padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 10px; }
.modal-body p    { font-size: var(--sz-sm); line-height: 1.7; color: var(--text2); }
.modal-body h3   { font-size: var(--sz-sm); font-weight: 700; color: var(--accent); margin-top: 4px; }
.modal-body strong { color: var(--text); }
.modal-date      { font-size: var(--sz-xs); color: var(--text3); font-family: var(--font-mono); }

/* ── Scrollbar ───────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

/* ── Mobile ──────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .msg { max-width: 90%; }
  #name-input { width: 85px; }
  footer.footer-main { font-size: 10px; padding: 5px 10px; }
  footer.footer-ad { min-height: 50px; }
  /* donate-btn stays visible on mobile — just shrink it */
  .donate-btn { font-size: 10px; padding: 2px 6px; }
}

/* ── Utility classes replacing inline styles ─────────────────────────────────── */
.dd-wrap { position: relative; }
.file-panel-inner { flex: 1; display: flex; flex-direction: column; gap: 6px; }

.dd-section-top { border-bottom: 1px solid var(--border); }

.url-blocked-label { font-size: 0.65em; opacity: 0.6; }

.link-domain { display: block; font-size: 0.75em; opacity: 0.65; margin-top: 3px; font-family: var(--font-mono); }

.file-card-error { padding: 8px 12px; color: var(--danger); font-size: var(--sz-sm); border: 1px solid var(--danger); border-radius: var(--radius-sm); background: var(--danger-bg); }

/* Default to a standard slim mobile banner (320x50) */
.local-share-ad { 
  width: 320px; 
  height: 50px; 
}

/* On tablets and desktops (768px and wider), scale up to standard leaderboard (728x90) */
@media (min-width: 768px) {
  .local-share-ad { 
    width: 728px; 
    height: 90px; 
  }
}