:root {
  --canvas: #f3f6f4;
  --paper: #fff;
  --paper-soft: #f5f8f6;
  --ink: #172c27;
  --muted: #566961;
  --line: #dbe6df;
  --line-strong: #bccfc4;
  --accent: #21765c;
  --accent-dark: #184e3f;
  --accent-soft: #e8f3ec;
  --warm: #daf4a8;
  --shadow: 0 8px 30px rgb(25 52 42 / 5%);
  --radius: 21px;
  --radius-small: 12px;
}

body { background: radial-gradient(ellipse at 15% 2%, #e8f1eb, transparent 38rem), var(--canvas); }
.app-shell { width: min(1120px, calc(100% - 48px)); padding: 24px 0; }
.topbar { gap: 12px; min-height: 50px; padding-bottom: 10px; }
.brand { gap: 12px; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; box-shadow: none; }
.brand strong { font-size: 1.16rem; font-weight: 850; }
.brand small { font-size: .74rem; }
.topbar-actions { gap: 7px; }
.preview-pill { margin-inline-end: 6px; padding: 5px 8px; border: 1px solid #ccdbd2; border-radius: 999px; color: var(--accent-dark); font-size: .69rem; font-weight: 750; white-space: nowrap; }
.icon-button { border-radius: 11px; }
.icon-button:hover { border-color: #aec4b8; color: var(--accent-dark); }
.workspace { grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr); gap: 16px; padding-top: 12px; align-items: start; }
.panel { padding: 22px; border: 1px solid var(--line); background: var(--paper); backdrop-filter: none; }
.side-column { gap: 14px; }
.compose-panel { padding: 24px; }
.compose-panel .panel-heading { align-items: center; margin-bottom: 16px; }
h1 { font-size: 1.6rem; letter-spacing: -.04em; }
h2 { font-size: 1.12rem; }
.panel-heading.compact { margin-bottom: 14px; }
.compose-form { gap: 12px; }
.choice-block { gap: 6px; }
.choice-label { font-weight: 650; }
.segmented { gap: 3px; padding: 3px; border: 1px solid #e3ebe6; border-radius: 11px; background: #f0f4f1; }
.segmented label > span { min-height: 36px; border-radius: 8px; font-weight: 700; }
.segmented input:checked + span { color: var(--accent-dark); background: #fff; box-shadow: 0 1px 3px rgb(25 52 42 / 14%); }
.segmented input:focus-visible + span, .quiet-button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.compose-form > .choice-block svg { width: 15px; height: 15px; flex: none; }
.content-composer { gap: 8px; }
.drop-zone { min-height: 180px; display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; gap: 13px; padding: 17px 12px; border: 1px dashed #b5cbbc; border-radius: 15px; background: radial-gradient(circle, #d6e4da 1px, transparent 1.25px) 0 0 / 15px 15px, #f5faf7; }
.drop-prompt { display: grid; justify-items: center; text-align: center; gap: 7px; }
.drop-icon { width: 42px; height: 42px; border: 1px solid #d0e4d6; border-radius: 13px; color: var(--accent-dark); background: #e3f1e8; }
.drop-zone strong { font-size: .95rem; }
.drop-zone span { font-size: .76rem; font-weight: 500; }
.file-picker-actions, .drop-zone[data-picker-mode="touch"] .file-picker-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.file-picker-actions .secondary-button { min-height: 38px; padding-inline: 12px; background: white; font-size: .82rem; font-weight: 720; }
.file-picker-actions .secondary-button:hover { border-color: var(--accent); }
.file-picker-actions #pickButton { border-color: #c2dbcc; color: var(--accent-dark); background: #edf6f0; }
.selected-strip { padding: 8px; gap: 7px; }
.selected-heading { display: flex; justify-content: space-between; align-items: center; gap: 5px; min-width: 0; }
.selected-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: .78rem; }
.quiet-button { flex: none; min-height: 30px; border: 0; border-radius: 7px; padding: 0 8px; color: var(--accent-dark); background: #eaf3ed; font-size: .75rem; font-weight: 760; cursor: pointer; white-space: nowrap; }
.quiet-button:hover { background: #dcece2; }
.text-composer { gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-soft); }
.text-composer textarea { min-height: 126px; }
.delivery-options, .delivery-options.is-private { gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-soft); }
.delivery-options > .choice-block { grid-template-columns: 3.65rem minmax(0, 1fr); align-items: center; gap: 8px; }
.delivery-options .segmented label > span { min-height: 32px; }
.primary-button { background: #153a33; box-shadow: none; }
.primary-button:hover { background: #1d5143; }
.primary-button:disabled { color: #50645a; background: #e3ece6; }
.send-button { min-height: 47px; border-radius: 12px; font-size: .94rem; }
.service-note { display: block; margin: 10px 0 0; color: var(--muted); font-size: .69rem; }
.pickup-form { grid-template-columns: minmax(0, 1fr) auto; margin-top: 0; }
.pickup-input { display: flex; align-items: center; min-width: 0; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--paper-soft); padding-right: 5px; }
.pickup-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px #dceee3; }
.pickup-input #codeInput { min-width: 0; min-height: 41px; border: 0; outline: 0; background: transparent; box-shadow: none; font-weight: 600; }
.pickup-form .primary-button { min-width: 62px; }
#pickupBadge:not([data-state="active"]) { background: var(--paper-soft); color: var(--muted); }
.sync-line { margin: 3px 0 0; gap: 6px; font-size: .72rem; }
.live-dot { width: 6px; height: 6px; box-shadow: none; }
.public-grid { grid-template-columns: 1fr; gap: 0; max-height: 440px; }
.public-item { min-width: 0; border: 0; border-radius: 0; background: #fff; }
.public-item + .public-item { border-top: 1px solid var(--line); }
.public-item .file-button { aspect-ratio: auto; min-height: 51px; grid-template-columns: 34px minmax(0, 1fr) auto; justify-items: stretch; gap: 8px; padding: 6px 4px; border-radius: 6px; background: transparent; }
.public-item .file-button:hover, .public-item .file-button:focus-visible { background: #f2f8f4; outline-offset: -3px; }
.file-art { position: relative; display: grid; align-items: center; width: 34px; height: 34px; border-radius: 8px; overflow: hidden; background: #e7f1eb; }
.public-item .file-fallback { width: 100%; height: 100%; border-radius: 0; color: var(--accent-dark); background: transparent; font-size: .63rem; }
.public-item .file-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.public-item .is-preview-broken img { display: none; }
.public-item .preview-placeholder { min-height: 0; padding: 0; font-size: 0; }
.public-item-info { min-width: 0; padding: 0; }
.public-item-info span { margin-top: 2px; font-size: .69rem; }
.file-action { padding: 5px 7px; border-radius: 7px; color: var(--accent-dark); background: #eaf3ed; font-size: .71rem; font-weight: 750; white-space: nowrap; }
.public-panel .empty-state { min-height: 115px; border-radius: 11px; background: var(--paper-soft); }
.share-result { padding: 14px; margin-top: 12px; gap: 8px; background: #153a33; }
#closeResult { justify-self: end; min-height: 35px; color: #edf8ed; border-color: #55776b; background: transparent; font-size: .79rem; }
#closeResult:hover { background: #2c5246; }
.share-link-row { grid-template-columns: minmax(0, 1fr); }
.share-link-row .share-code { color: #daf4a8; font-family: ui-monospace, monospace; font-size: 1.5rem; letter-spacing: .14em; font-weight: 760; }
.share-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-actions > button { flex: 1; min-height: 37px; font-size: .8rem; }
.share-actions .quiet-button { background: #e4f1e8; }
.manual-copy { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid #b6c9bf; border-radius: 7px; }
.settings-menu, .access-settings-menu, .text-preview-sheet { border-color: var(--line); border-radius: 16px; background: #fff; }
#textPreviewContent { width: 100%; min-height: 120px; field-sizing: content; }
.access-card { border-color: var(--line); border-radius: 22px; background: #fff; }
.access-heading { align-items: center; margin-bottom: 20px; }
.access-heading p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
#accessSubmit { background: #153a33; }

@media (min-width: 681px) and (max-width: 850px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .side-column { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (min-width: 851px) {
  .side-column { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .app-shell { width: min(calc(100% - 20px), 560px); padding: 10px 0 8px; }
  .topbar { min-height: 42px; padding: 0 2px; }
  .brand { gap: 7px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand strong { font-size: 1.02rem; }
  .preview-pill { margin-inline-end: 2px; }
  .workspace { padding-top: 7px; }
  .panel { padding: 13px; border-radius: 16px; }
  .compose-panel .panel-heading, .panel-heading.compact { margin-bottom: 9px; }
  h1 { font-size: 1.24rem; }
  .compose-form { gap: 8px; }
  .choice-block { gap: 3px; }
  .segmented label > span { min-height: 34px; }
  .drop-zone { min-height: 99px; gap: 7px; align-content: center; justify-items: stretch; padding: 8px; border-radius: 12px; }
  .drop-prompt { display: flex; justify-content: flex-start; text-align: start; }
  .drop-icon { width: 36px; height: 36px; }
  .drop-zone strong { font-size: .84rem; }
  .drop-zone span { font-size: .7rem; }
  .file-picker-actions, .drop-zone[data-picker-mode="touch"] .file-picker-actions { justify-content: stretch; }
  .file-picker-actions .secondary-button { flex: 1; min-height: 34px; padding-inline: 5px; font-size: .72rem; }
  .delivery-options, .delivery-options.is-private { padding: 7px; }
  .delivery-options > .choice-block { grid-template-columns: 3.1rem minmax(0, 1fr); gap: 5px; }
  .delivery-options .segmented label > span { min-height: 32px; }
  .ttl-options label > span { font-size: .64rem; }
  .send-button { min-height: 45px; }
  .service-note { margin-top: 7px; }
  #codeInput, #textContent, #textName { font-size: 16px; }
  .mobile-dock { bottom: max(6px, env(safe-area-inset-bottom)); border-color: var(--line); background: rgb(255 255 255 / 97%); box-shadow: 0 6px 22px rgb(21 58 51 / 12%); }
  .mobile-dock button[aria-selected="true"] { color: var(--accent-dark); background: #e4f1e8; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
