:root {
  color-scheme: light;
  --bg: #f4f8f0;
  --panel: #fcfef9;
  --field: #f4f8f1;
  --ink: #14261a;
  --muted: #4e6353;
  --line: #cddacb;
  --accent: #24603c;
  --button: #c4f5a4;
  --button-hover: #afe88b;
  --button-ink: #102718;
  --art-bg: #deebd9;
  --art-halo: #b7d7ae;
  --art-line: #8fb793;
  --device: #334d3e;
  --device-screen: #172c22;
  --error: #a02e30;
  --warning-bg: #faecea;
  font: 16px/1.55 "Instrument Sans", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101713;
  --panel: #18231c;
  --field: #121b15;
  --ink: #ebf5e9;
  --muted: #b3c7b6;
  --line: #3f5244;
  --accent: #b4ee99;
  --button: #bbed9d;
  --button-hover: #d1fac1;
  --button-ink: #122619;
  --art-bg: #18281d;
  --art-halo: #2e5138;
  --art-line: #4e775a;
  --device: #5d8169;
  --device-screen: #203829;
  --error: #ffad9f;
  --warning-bg: #392827;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #101713;
    --panel: #18231c;
    --field: #121b15;
    --ink: #ebf5e9;
    --muted: #b3c7b6;
    --line: #3f5244;
    --accent: #b4ee99;
    --button: #bbed9d;
    --button-hover: #d1fac1;
    --button-ink: #122619;
    --art-bg: #18281d;
    --art-halo: #2e5138;
    --art-line: #4e775a;
    --device: #5d8169;
    --device-screen: #203829;
    --error: #ffad9f;
    --warning-bg: #392827;
  }
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100vh; }
.wrap { width: min(1136px, calc(100% - 64px)); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); }
.top-inner, .preferences, .brand, .actions, .item-actions { display: flex; align-items: center; }
.top-inner { min-height: 76px; justify-content: space-between; gap: 14px; }
.brand { gap: 10px; color: var(--ink); font-size: 1.19rem; font-weight: 750; letter-spacing: -.05em; text-decoration: none; }
.brand img { flex: 0 0 auto; }
.preferences { gap: 8px; }
.preferences select { min-height: 38px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--panel); }
.hero { min-height: min(600px, calc(100svh - 150px)); padding-block: 52px; display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: clamp(24px, 4vw, 64px); }
h1, h2 { line-height: 1.1; margin: 0; letter-spacing: -.055em; text-wrap: balance; }
.hero h1 { font-size: clamp(3.3rem, 7vw, 6.1rem); line-height: .98; }
.hero-copy p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.2rem); max-width: 36ch; margin: 23px 0 26px; }
.actions { gap: 10px; flex-wrap: wrap; }
button, input, select, textarea { font: inherit; }
button, summary, select { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .55; cursor: default; }
.primary, .secondary { display: inline-flex; gap: 12px; align-items: center; justify-content: center; min-height: 45px; border-radius: 9px; padding: 8px 15px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 680; text-decoration: none; text-align: center; }
.primary { background: var(--button); color: var(--button-ink); border-color: transparent; }
.primary:hover:not(:disabled) { background: var(--button-hover); }
.secondary:hover:not(:disabled) { background: var(--field); }
.hero-art { position: relative; display: grid; align-items: center; width: 100%; aspect-ratio: 1.1; isolation: isolate; background: radial-gradient(ellipse at center, var(--art-halo), transparent 68%), var(--art-bg); overflow: hidden; border: 1px solid var(--line); border-radius: 26px; }
.orbit { position: absolute; width: 73%; aspect-ratio: 1; border: 1px solid var(--art-line); border-radius: 50%; left: 50%; top: 50%; transform: translate(-50%, -50%); opacity: .65; }
.orbit-inner { width: 52%; opacity: .5; }
.device { position: absolute; display: grid; place-items: center; height: 35%; border: clamp(4px, .8vw, 8px) solid var(--device); box-shadow: 0 16px 28px #10231e36; background: var(--device-screen); }
.laptop { left: 15%; width: 42%; top: 29%; border-radius: 13px 13px 7px 7px; transform: rotate(-10deg); }
.laptop::after { content: ""; position: absolute; width: 116%; height: 8%; left: -8%; top: calc(100% + 3px); background: var(--device); border-radius: 3px 3px 15px 15px; }
.phone { right: 18%; width: 21%; height: 45%; top: 37%; border-radius: 17px; transform: rotate(13deg); }
.phone::after { content: ""; position: absolute; width: 38%; bottom: 5%; height: 2px; background: var(--device); border-radius: 4px; }
.device-mark { display: grid; place-items: center; width: 45%; max-width: 45px; aspect-ratio: 1; border-radius: 12px; font-size: clamp(.9rem, 2.6vw, 1.45rem); color: var(--button-ink); background: var(--button); }
.link-track { z-index: 1; position: absolute; width: 24%; left: 53%; top: 48%; border-top: 2px dashed var(--art-line); transform: rotate(13deg); }
.link-track span { position: absolute; width: 9px; height: 9px; top: -5px; left: 0; border-radius: 50%; background: var(--accent); animation: travel 3.1s ease-in-out infinite both; }
.link-track span:nth-child(2) { animation-delay: .6s; }
.link-track span:nth-child(3) { animation-delay: 1.2s; }
@keyframes travel { 0% { left: 0; opacity: 0; } 20%, 65% { opacity: 1; } 83%, 100% { left: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .link-track span { animation: none; left: 40%; } .link-track span:nth-child(2) { left: 56%; } .link-track span:nth-child(3) { left: 72%; } }
.workflow { margin: 36px auto; max-width: 940px; }
.back { display: inline-block; margin-bottom: 13px; color: var(--accent); text-decoration: none; font-size: .92rem; font-weight: 690; }
.panel { min-width: 0; padding: clamp(17px, 4vw, 31px); border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.panel h1 { font-size: clamp(1.65rem, 4vw, 2.3rem); }
.panel h2 { font-size: 1.38rem; }
.muted { color: var(--muted); margin: 8px 0 14px; }
label { display: block; font-size: .86rem; font-weight: 680; margin: 13px 0 5px; }
input:not([type="file"]), textarea { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--field); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; font-size: .88rem; }
textarea { resize: vertical; min-height: 90px; }
.form-actions { margin-top: 19px; }
.box-tag, .state { display: inline-block; border: 1px solid var(--line); background: var(--field); color: var(--accent); padding: 4px 9px; margin-bottom: 8px; font-size: .8rem; border-radius: 7px; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.state { font-family: inherit; align-self: flex-start; white-space: nowrap; }
.session-top { display: flex; justify-content: space-between; gap: 12px; }
.session-panel { margin-bottom: 16px; }
.session-panel h1 { margin-bottom: 12px; }
#expiry { font-variant-numeric: tabular-nums; font-size: .88rem; }
.share-rows { margin: 12px 0; max-width: 650px; }
.share-row > div { display: flex; gap: 7px; }
.share-row input { font-family: ui-monospace, monospace; font-size: .86rem; flex: 1; }
.copy { min-height: 36px; padding: 4px 9px; font-size: .8rem; }
.feedback { color: var(--accent); margin: 11px 0 13px; font-size: .9rem; overflow-wrap: anywhere; }
.feedback[data-error="true"] { color: var(--error); }
.transfer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tabs { display: flex; gap: 3px; border: 1px solid var(--line); background: var(--field); border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.tabs button { flex: 1; min-height: 36px; border: 1px solid transparent; color: var(--muted); border-radius: 6px; background: transparent; }
.tabs button[aria-pressed="true"] { border-color: var(--line); color: var(--ink); background: var(--panel); font-weight: 650; }
#text-form .primary, #file-form .primary { margin-top: 12px; }
.drop { min-height: 103px; width: 100%; display: grid; justify-items: center; align-content: center; border: 1px dashed var(--accent); border-radius: 9px; color: var(--ink); background: var(--field); padding: 8px; }
.drop[data-over="true"], .drop:hover:not(:disabled) { background: var(--art-bg); }
.drop-plus { font-size: 1.35rem; color: var(--accent); line-height: 1; }
.drop small { color: var(--muted); }
.items { list-style: none; padding: 0; margin: 0; }
.items li { margin-top: 8px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--field); overflow-wrap: anywhere; }
.item-text { white-space: pre-wrap; max-height: 13rem; overflow: auto; }
.item-actions { gap: 7px; flex-wrap: wrap; margin-top: 8px; }
.progress label { overflow-wrap: anywhere; }
progress { width: 100%; accent-color: var(--accent); }
footer { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 18px 0 26px; color: var(--muted); font-size: .8rem; }
footer details { max-width: 360px; }
footer summary { color: var(--accent); }
footer details p { margin: 6px 0 0; }
@media (max-width: 750px) {
  .wrap { width: min(600px, calc(100% - 34px)); }
  .hero { min-height: 0; grid-template-columns: 1fr; align-content: start; gap: 24px; padding-block: 30px; }
  .hero h1 { font-size: clamp(2.95rem, 12vw, 5rem); }
  .hero-copy p { margin: 12px 0 17px; }
  .hero-art { max-height: 330px; aspect-ratio: 1.5; }
  .transfer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 410px) {
  .wrap { width: calc(100% - 24px); }
  .top-inner { min-height: 62px; gap: 6px; }
  .brand { font-size: 1.03rem; gap: 5px; }
  .brand img { width: 28px; height: 28px; }
  .preferences { gap: 4px; }
  .preferences select { font-size: .74rem; max-width: 94px; padding-inline: 3px; }
  .workflow { margin-block: 22px; }
  footer { flex-direction: column; gap: 8px; }
}
.theme-toggle { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); }
.theme-toggle button { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); padding: 0; }
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-pressed="true"] { border-color: var(--line); background: var(--panel); color: var(--accent); }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-art { height: 132px; width: min(290px, 100%); margin-top: 20px; aspect-ratio: auto; border-radius: 16px; }
.hero-art .device-mark { border-radius: 5px; font-size: .92rem; max-width: 22px; }
.hero-art .device { border-width: 4px; }
.hero-art .phone { border-radius: 9px; }
.hero-art .laptop { border-radius: 7px; }
.composer { box-shadow: 0 16px 60px #12281c0d; }
.composer fieldset { margin: 0; border: 0; padding: 0; min-width: 0; }
.composer legend { display: block; padding: 0; font-size: 1.48rem; font-weight: 730; letter-spacing: -.035em; }
.composer .drop { margin-top: 14px; }
.composer .items { max-height: 174px; overflow: auto; }
.composer .items li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer .items li > span { min-width: 0; }
.draft-actions { margin-top: 19px; text-align: center; }
#start-share { width: 100%; min-height: 56px; border-radius: 10px; font-size: 1.05rem; font-weight: 750; }
#start-share-help { margin: 8px 0 0; font-size: .82rem; }
.text-action { border: 0; border-radius: 5px; background: transparent; color: var(--accent); padding: 7px 3px; font-size: .86rem; font-weight: 650; }
.text-action:hover:not(:disabled) { text-decoration: underline; }
.back { border: 0; background: transparent; padding: 0; }
@media (max-width: 750px) {
  .hero-art { display: none; }
  .hero { gap: 20px; }
}
@media (max-width: 410px) {
  .theme-toggle button { width: 27px; height: 29px; }
  .theme-toggle svg { width: 15px; height: 15px; }
}
:root { --field-focus: #e9f1e7; }
:root[data-theme="dark"] { --field-focus: #25362b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --field-focus: #25362b; } }
input:not([type="file"]):focus, textarea:focus, select:focus, .drop:focus {
  outline: none;
  box-shadow: none;
  background-color: var(--field-focus);
}
.transfer-grid { grid-template-columns: minmax(0, 1fr) minmax(155px, .37fr); }
.chat-list { max-height: min(52vh, 520px); overflow: auto; }
.chat-list li { padding: 11px 12px; }
.chat-list li[data-mine="true"] { background: var(--art-bg); }
.chat-meta { color: var(--muted); font-size: .79rem; margin-bottom: 5px; overflow-wrap: anywhere; }
.chat-drop { min-height: 62px; margin-top: 8px; }
#recipients { min-width: 0; margin: 0; padding: 0; border: 0; }
#recipients legend { font-size: .9rem; font-weight: 650; padding: 0; }
#toggle-recipients { padding: 6px 0; margin-bottom: 4px; }
#recipient-options { display: flex; flex-wrap: wrap; gap: 8px; }
#recipient-options label { display: flex; gap: 8px; align-items: center; min-height: 42px; max-width: 100%; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--field); }
#recipient-options label:has(:checked) { border-color: var(--accent); }
#recipient-options span { overflow-wrap: anywhere; min-width: 0; }
#recipient-options input { width: 17px; height: 17px; margin: 0; flex: 0 0 17px; accent-color: var(--accent); }
#recipient-empty { font-size: .8rem; margin: 6px 0 0; }
.composer-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px; margin-top: 16px; }
.send-actions { display: flex; flex-direction: column; gap: 8px; }
#post { min-width: 150px; min-height: 48px; }
@media (max-width: 650px) {
  .composer-footer { grid-template-columns: 1fr; gap: 14px; }
  #recipient-options label { flex: 1 1 150px; }
  .send-actions { align-items: stretch; }
}
#chat-form button.copy { margin-left: 7px; }
.participants li { display: grid; gap: 2px; }
.participants small { color: var(--muted); }
@media (max-width: 750px) { .transfer-grid { grid-template-columns: 1fr; } }
.chat-panel select:focus { background-color: var(--field-focus); }

.action-dialog { width: min(420px, calc(100% - 32px)); color: var(--ink); box-shadow: 0 20px 65px #0c19164d; }
.action-dialog::backdrop { background: #0c191678; }
.action-dialog .actions { justify-content: flex-end; margin-top: 20px; }
.remove-confirm { color: var(--error); border-color: currentColor; }

.box-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 15px; padding-block: 12px; border-bottom: 1px solid var(--line); }
.open-boxes, .box-nav-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.open-boxes { min-width: 0; }
.box-nav button { min-height: 36px; font-size: .83rem; padding: 5px 10px; }
.box-tab { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.box-tab[aria-current="page"], .box-tab[aria-current="page"]:hover:not(:disabled) { background: var(--art-bg); border-color: var(--accent); }

.info-main { padding-top: 20px; }
.info-toolbar, .info-nav, .info-languages { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; }
.info-toolbar { justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.info-nav a, .info-languages a { font-size: .86rem; font-weight: 650; text-decoration: none; color: var(--muted); }
.info-nav a:hover, .info-nav a[aria-current="page"], .info-languages a:hover, .info-languages a[aria-current="page"] { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.info-heading { max-width: 790px; margin: 35px 0 24px; }
.info-heading h1 { font-size: clamp(2.55rem, 6vw, 4.6rem); }
.info-heading p { color: var(--muted); font-size: clamp(1rem, 2vw, 1.18rem); margin: 12px 0 0; }
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.guide-card { margin: 0; padding: 0; overflow: hidden; }
.guide-card img { display: block; width: 100%; height: auto; }
.guide-card figcaption { padding: 16px; }
.guide-card h2 { font-size: 1.24rem; }
.guide-card p { color: var(--muted); margin: 7px 0 0; font-size: .91rem; }
.info-jump { padding: 18px 0 6px; }
.faq-section, .policy-section { scroll-margin-top: 1rem; margin: 26px 0; }
.faq-section > h2, .policy-section > h2 { font-size: 1.46rem; margin: 0 0 12px; }
.faq-questions { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.faq-questions details + details { border-top: 1px solid var(--line); }
.faq-questions summary { padding: 12px 14px; color: var(--ink); font-weight: 680; }
.faq-questions summary::marker { color: var(--accent); }
.faq-questions details[open] summary { color: var(--accent); }
.faq-questions p { color: var(--muted); margin: 0; padding: 0 16px 15px; max-width: 85ch; }
.faq-action { margin: 22px 0 28px; }
.policy-date { color: var(--muted); font-size: .86rem; }
.info-note, .operator { padding: 12px 15px; margin: 0 0 16px; border-radius: 10px; color: var(--ink); background: var(--art-bg); }
.operator { display: flex; gap: 14px 28px; flex-wrap: wrap; }
.operator dt { font-weight: 700; }
.operator dd { margin: 2px 0; overflow-wrap: anywhere; }
.policy-grid { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(0, 3fr); align-items: start; gap: 26px; }
.policy-toc { position: sticky; top: 15px; padding: 16px; font-size: .88rem; }
.policy-toc ul { padding-left: 17px; margin-bottom: 0; }
.policy-toc li + li { margin-top: 5px; }
.policy-content { max-width: 80ch; }
.policy-section:first-child { margin-top: 0; }
.policy-section p { margin: 0 0 12px; }
.info-main a:not(.brand, .secondary, .primary) { color: var(--accent); }
.source-links { display: flex; flex-wrap: wrap; padding: 0; gap: 5px 12px; list-style: none; font-size: .83rem; }
.info-footer { margin-top: 22px; }
.data-flow { display: grid; gap: 22px; padding: clamp(14px, 3vw, 28px); }
.flow-stage { min-width: 0; }
.flow-stage h3 { font-size: 1.08rem; line-height: 1.25; margin: 0; }
.flow-stage p { color: var(--muted); font-size: .9rem; margin: 5px 0 0; }
.flow-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}
.flow-node { border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 12px 14px; }
.flow-node strong { display: block; line-height: 1.3; }
.flow-cloud { background: var(--panel); }
.flow-storage { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.flow-arrow { color: var(--accent); font-size: 1.4rem; line-height: 1; text-align: center; }
.flow-stage .flow-note { margin-top: 12px; }
.flow-transfer { border-top: 1px solid var(--line); padding-top: 20px; }
.flow-transfer .flow-node:nth-child(3) { border-color: var(--art-line); background: var(--art-bg); }
@media (max-width: 750px) {
  .guide-grid, .policy-grid { grid-template-columns: minmax(0, 1fr); }
  .guide-card { display: grid; grid-template-columns: minmax(105px, 1fr) 1.65fr; align-items: center; }
  .guide-card img { height: 100%; object-fit: cover; }
  .flow-route { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .flow-arrow { justify-self: center; transform: rotate(90deg); }
  .policy-toc { position: static; }
  .info-app { min-height: 40px; font-size: .85rem; padding: 7px 9px; }
}
@media (max-width: 495px) {
  .guide-card { display: block; }
  .guide-card img { height: auto; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-wrap:has(#session:not([hidden])) { width: min(1640px, calc(100% - 64px)); }
#setup { max-width: 570px; }
#session { max-width: none; }
#session .session-top { align-items: baseline; justify-content: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
#session .session-top h1 { font-size: clamp(1.35rem, 3vw, 2rem); }
#session .state { margin: 0; }
#session .transfer-grid {
  grid-template-columns: minmax(260px, 300px) minmax(0, 1fr) minmax(170px, 230px);
  grid-template-areas: "invite chat devices";
  align-items: start;
}
#session .session-panel { grid-area: invite; padding: 17px; margin: 0; }
#session .chat-panel { grid-area: chat; }
#session .participants { grid-area: devices; padding: 17px; }
#invite-details summary { font-weight: 720; color: var(--ink); overflow-wrap: anywhere; }
#invite-details summary::marker { color: var(--accent); }
#invite-details .box-tag { margin: 9px 0 0; }
#invite-details .share-rows { margin: 3px 0 0; }
#invite-details .share-row > div { align-items: center; }
#invite-details .share-row input { min-height: 40px; padding: 6px 8px; }
#invite-details .share-row label { margin-top: 9px; }
#invite-details .copy { min-height: 40px; flex: 0 0 auto; }
#invite-details .feedback { margin-bottom: 0; }
.invite-qr { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; }
.invite-qr img { display: block; width: min(100%, 180px); height: auto; margin-inline: auto; }
.invite-qr figcaption { margin-top: 6px; color: var(--muted); font-size: .8rem; }
.pin-display { display: flex; align-items: center; gap: 3px; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
#invite-details input.pin-cell { width: 22px; text-align: center; padding: 0; font-weight: 720; border-radius: 5px; }
.pin-dash { color: var(--muted); }
#share-pin[data-segmented="true"] { position: absolute; width: 1px; min-height: 0; height: 1px; padding: 0; clip-path: inset(50%); }
#invite-details #share-password { flex: 0 1 182px; }
.session-timer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; padding: 10px 0; margin-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
#expiry { color: var(--ink); font-weight: 690; }
#end-session { min-height: 40px; font-size: .86rem; }
#setup .compact-pin { width: min(100%, 178px); }
#setup .compact-passphrase { width: min(100%, 290px); }
#setup .security-level { min-width: 0; padding: 0; margin: 18px 0 12px; border: 0; }
#setup .security-level legend { font-weight: 720; padding: 0; margin-bottom: 7px; }
.security-option { padding: 6px 11px 8px; margin-bottom: 6px; background: var(--field); border: 1px solid var(--line); border-radius: 9px; }
.security-option > div { margin-bottom: 3px; }
.security-choice { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; min-height: 40px; }
.security-choice small { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; }
.security-option input:not(.switch) { background: var(--panel); }
.security-option input:not(.switch):focus { background: var(--field-focus); }
.security-choice input.switch {
  appearance: none; flex: 0 0 auto; position: relative; width: 38px; height: 22px; margin: 0;
  padding: 0; border-radius: 20px; background: var(--panel); cursor: pointer;
}
.security-choice .switch::before {
  content: ""; width: 14px; height: 14px; position: absolute; top: 3px; left: 3px;
  border-radius: 50%; background: var(--muted); transition: transform .15s ease;
}
.security-choice .switch:checked { background: var(--button); border-color: transparent; }
.security-choice .switch:checked::before { transform: translateX(16px); background: var(--button-ink); }
.security-choice .switch:focus { background-color: var(--panel); }
.security-choice .switch:checked:focus { background-color: var(--button); }
.security-choice .switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#idle-minutes { border: 1px solid var(--line); border-radius: 8px; min-height: 43px; padding: 6px 10px; color: var(--ink); background: var(--field); }
#idle-minutes:focus { background: var(--field-focus); }
#idle-help, #device-help { font-size: .85rem; }
#regenerate { padding-inline: 0; }
.turnstile { margin-top: 12px; }
#rate-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.box-tab { max-width: 100%; }
@media (max-width: 1080px) {
  #session .transfer-grid { grid-template-columns: minmax(244px, 270px) minmax(0, 1fr); grid-template-areas: "invite chat" "devices chat"; grid-template-rows: auto 1fr; }
}
@media (max-width: 720px) {
  .app-wrap:has(#session:not([hidden])) { width: calc(100% - 24px); }
  #session .transfer-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "invite" "chat" "devices"; grid-template-rows: none; gap: 10px; }
  #session .session-panel, #session .participants { padding: 13px; }
  #invite-details .copy { min-height: 44px; }
  #session .state { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .security-choice .switch::before { transition: none; } }

.box-identifiers { margin: 5px 0; }
.box-identifiers > div { padding: 5px 0; }
.box-identifiers > div + div { border-top: 1px solid var(--line); }
.box-identifiers dt { font-weight: 680; font-size: .78rem; color: var(--muted); }
.box-identifiers dd { margin: 1px 0 0; font: .88rem/1.4 ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.reservation-option .security-choice { cursor: default; }
.required-check { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; border-radius: 50%; color: var(--accent); background: var(--art-bg); font-weight: 800; }
#reservation-status { margin: 4px 0; font-size: .78rem; }
#join-pin-field { min-width: 0; padding: 0; border: 0; margin: 13px 0 0; }
#join-pin-field legend { padding: 0; margin-bottom: 5px; font-size: .86rem; font-weight: 680; }
.pin-entry-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; }
.pin-entry-row .pin-display { gap: 4px; }
.pin-entry-row input.pin-cell { width: 33px; min-height: 42px; padding: 0; text-align: center; font: 720 1rem/1 ui-monospace, monospace; border-radius: 6px; }
.security-warning { padding: 10px 12px; margin: 7px 0; border-radius: 8px; background: var(--warning-bg); }
.security-warning strong { color: var(--error); font-size: .85rem; }
.security-warning p { margin: 3px 0 0; font-size: .80rem; }
.setup-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; justify-content: space-between; margin-top: 13px; }
.setup-actions label { margin-top: 0; }
.reservation-spinner {
  width: 1em;
  height: 1em;
  flex: none;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: reservation-spin .75s linear infinite;
}
@keyframes reservation-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  .reservation-spinner { animation: none; }
}
#idle-minutes { min-height: 45px; }
.setup-box-details .reservation-option { margin-top: 14px; }
.idle-control { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.idle-control label { margin: 0; }
#idle-help { margin: 5px 0 0; max-width: 62ch; }
@media (min-width: 780px) {
  #setup[data-mode="host"] { max-width: 960px; }
  #setup[data-mode="host"] .setup-options {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 32px);
    align-items: start;
    margin-top: 18px;
  }
  #setup[data-mode="host"] #device-field label { margin-top: 0; }
  #setup[data-mode="host"] .security-level { margin: 0; }
  #setup[data-mode="host"] .setup-actions {
    margin-top: 12px;
    padding-top: 13px;
    border-top: 1px solid var(--line);
    align-items: center;
  }
}
.box-tab-group { display: inline-flex; max-width: 100%; border-radius: 9px; border: 1px solid var(--line); background: var(--panel); }
.box-tab-group:has([aria-current="page"]) { border-color: var(--accent); background: var(--art-bg); }
.box-tab-group .box-tab, .box-tab-group .box-tab-close { border: 0; background: transparent; }
.box-tab-group .box-tab { border-radius: 8px 0 0 8px; min-width: 0; overflow-wrap: anywhere; }
.box-tab-group .box-tab-close { border-radius: 0 8px 8px 0; padding-inline: 8px; min-width: 32px; flex: 0 0 auto; color: var(--muted); font-size: 1.04rem; line-height: 1; }
.box-tab-group .box-tab-close:hover:not(:disabled) { color: var(--error); background: var(--field-focus); }
#leave-box-id { margin: 10px 0 0; }
#leave-dialog h2 { text-wrap: initial; }
@media (max-width: 720px) {
  .box-tab-group .box-tab-close { min-width: 44px; min-height: 44px; }
}

.usage-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 8px; }
.usage-count { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.usage-count[data-full="true"] { color: var(--error); }
.participants-heading .usage-count { white-space: nowrap; }
.file-usage { margin: 6px 0 9px; text-align: end; }
.device-name-line, .inline-name-edit { display: flex; align-items: center; gap: 5px; min-width: 0; }
.device-name-line strong { min-width: 0; overflow-wrap: anywhere; }
.icon-action { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; min-height: 36px; padding: 4px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); }
.icon-action:hover { background: var(--art-bg); }
.inline-name-edit input { min-width: 0; width: 100%; padding: 6px 8px; }
#rename-form { margin: 0; }

#rename-form .feedback { margin-bottom: 0; }

.connection-feedback { padding: 10px; border-radius: 8px; color: var(--error); background: #d94b4b12; font-size: .8rem; line-height: 1.5; }
