:root {
  --page: #f3f4ee;
  --paper: #ffffff;
  --ink: #172b24;
  --muted: #53665b;
  --line: #d8dfd7;
  --accent: #1e6247;
  --accent-soft: #e7f1e9;
  --deep: #193b2e;
  --deep-line: #496659;
  --danger: #a23832;
}
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 16px/1.5 "Avenir Next", "Segoe UI", Arial, sans-serif; }
button, a { font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: #1e624733; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid #166342; outline-offset: 3px; }
.invite-panel :focus-visible { outline-color: #d7eeb3; }
.skip-link { position: absolute; left: 16px; top: -80px; z-index: 5; padding: 10px 14px; background: var(--paper); color: var(--ink); border: 1px solid var(--accent); border-radius: 5px; }
.skip-link:focus { top: 12px; }
.shell { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }
.top { min-height: 82px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 23px; letter-spacing: -.065em; }
.brand:hover { color: var(--accent); }
.brand-mark { display: inline-grid; place-items: center; width: 38px; height: 38px; color: var(--accent); }
.top-note { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; }
.top-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 42px; padding: 52px 0 43px; }
.eyebrow, .section-index, .invite-label, .room-tag, .history-note, footer > span { font-size: 11px; font-weight: 800; line-height: 1.3; letter-spacing: .12em; }
.eyebrow, .section-index { color: var(--accent); }
.intro h1 { font-size: clamp(37px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -.065em; margin: 14px 0 17px; font-weight: 750; text-wrap: balance; }
.intro h1 span { color: var(--accent); }
.intro p { color: var(--muted); max-width: 57ch; margin: 0; font-size: 16px; line-height: 1.65; }
.intro-guide { border-left: 1px solid var(--line); padding: 7px 0 4px 25px; min-width: 240px; }
.intro-guide span { font-size: 11px; letter-spacing: .14em; font-weight: 800; color: var(--accent); }
.intro-guide p { margin: 8px 0 0; font-size: 13px; line-height: 1.7; }
.workspace { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(0, 1.32fr); grid-template-areas: "invite devices"; gap: 18px; align-items: stretch; }
.devices-panel { grid-area: devices; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 30px; min-height: 465px; }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.panel-heading h2 { font-size: clamp(22px, 2.4vw, 27px); line-height: 1.18; letter-spacing: -.045em; margin: 8px 0 0; text-wrap: balance; }
.room-tag, .history-note { color: #69796f; white-space: nowrap; }
.status { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 9px 13px; margin: 26px 0 18px; background: #f0f5f0; border: 1px solid #dfebdf; border-radius: 7px; color: #295340; font-size: 13px; }
.status-indicator { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #839b89; }
.status[data-connected="true"] .status-indicator { background: #23845b; }
.status[data-error="true"] { background: #fff0ed; color: var(--danger); border-color: #f1d5cf; }
.status[data-error="true"] .status-indicator { background: var(--danger); }
.devices { display: grid; gap: 9px; }
.empty[hidden], .history-empty[hidden], progress[hidden] { display: none; }
.empty { min-height: 235px; border: 1px dashed #b8c9b9; border-radius: 9px; background: #fbfcfa; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px; }
.empty-visual { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; color: var(--accent); }
.empty-device { display: grid; place-items: end center; width: 47px; height: 59px; padding-bottom: 5px; border: 2px solid currentColor; border-radius: 7px; background: var(--paper); transform: rotate(-9deg); }
.empty-device span { width: 7px; height: 2px; border-radius: 2px; background: currentColor; }
.empty-device.small-screen { width: 34px; height: 51px; transform: rotate(8deg); }
.empty-bridge { width: 52px; border-top: 2px dashed #9ab29c; margin: 0 13px; }
.empty h3 { font-size: 18px; line-height: 1.2; letter-spacing: -.035em; margin: 0 0 7px; }
.empty p { color: var(--muted); max-width: 35ch; font-size: 13px; line-height: 1.6; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin: 18px 0 0; }
.hint strong { color: var(--ink); }
.device { min-width: 0; display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; animation: appear .2s ease-out both; }
.device-icon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--accent-soft); color: var(--accent); }
.device-name { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.device-name strong { font-size: 14px; overflow-wrap: anywhere; }
.device-name small { color: var(--muted); font-size: 12px; }
.button { border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: white; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 17px; font-size: 14px; font-weight: 750; line-height: 1.2; text-decoration: none; text-align: center; transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease; }
.button:hover { background: #154d37; }
.button.muted { background: transparent; border-color: #a7bfb0; color: var(--accent); }
.button.muted:hover { background: var(--accent-soft); }
.button:active { transform: translateY(1px); }
.button.small { min-height: 44px; padding: 8px 14px; font-size: 13px; }
.invite-panel { grid-area: invite; min-width: 0; display: flex; flex-direction: column; background: var(--deep); border-radius: 12px; padding: 30px; color: #f3f7f2; }
.invite-panel .section-index { color: #a5cfad; }
.invite-panel h2 { font-size: clamp(25px, 2.6vw, 31px); line-height: 1.16; letter-spacing: -.05em; max-width: 13ch; margin: 24px 0 12px; text-wrap: balance; }
.invite-panel > p { color: #c5d7cb; font-size: 14px; line-height: 1.65; margin: 0 0 29px; max-width: 34ch; }
.invite-label { color: #a9cab2; margin: 0 0 9px; }
.invite-field { min-width: 0; border: 1px solid var(--deep-line); border-radius: 7px; background: #214637; padding: 13px 14px; }
.invite-url { color: white; display: block; font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.invite-panel .actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.button-light { background: #eaf2e5; border-color: #eaf2e5; color: var(--ink); }
.button-light:hover { background: white; border-color: white; }
.button-outline { border-color: #789887; background: transparent; color: white; }
.button-outline:hover { background: #315745; }
.privacy { display: flex; gap: 12px; border-top: 1px solid var(--deep-line); margin-top: auto; padding-top: 23px; color: #c5d7cb; }
.privacy-icon { flex: none; color: #a5cfad; }
.privacy strong { color: #f3f7f2; font-size: 13px; }
.privacy p { font-size: 12px; line-height: 1.6; margin: 5px 0 0; }
.history { margin-top: 39px; border-top: 1px solid var(--line); padding-top: 24px; min-height: 148px; }
.history-empty { color: var(--muted); font-size: 14px; margin: 19px 0 0; }
.transfers { margin-top: 13px; }
.transfer { padding: 15px 0; border-top: 1px solid var(--line); }
.transfer-top { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.transfer-top strong { min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.transfer-top span { color: var(--muted); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.transfer-state { color: var(--muted); font-size: 12px; margin: 5px 0 0; font-variant-numeric: tabular-nums; }
.transfer progress { display: block; width: 100%; height: 6px; margin: 12px 0 0; appearance: none; border: 0; border-radius: 6px; background: #dfebdf; overflow: hidden; }
.transfer progress[hidden] { display: none; }
.transfer progress::-webkit-progress-bar { background: #dfebdf; }
.transfer progress::-webkit-progress-value { background: var(--accent); }
.transfer progress::-moz-progress-bar { background: var(--accent); }
.transfer .actions { margin-top: 12px; }
footer { display: flex; justify-content: space-between; align-items: start; gap: 25px; border-top: 1px solid var(--line); margin-top: 37px; padding: 20px 0 28px; color: var(--muted); }
footer > span { color: var(--accent); white-space: nowrap; }
footer p { font-size: 12px; margin: 0; max-width: 65ch; }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 860px) {
  .intro { grid-template-columns: 1fr; gap: 20px; padding: 40px 0 34px; }
  .intro-guide { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0 0; }
  .intro-guide p { margin: 5px 0 0; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-areas: "invite" "devices"; }
  .devices-panel { min-height: 0; }
  .invite-panel { min-height: 0; }
  .invite-panel h2 { max-width: none; margin-top: 16px; }
  .invite-panel > p { max-width: none; margin-bottom: 22px; }
  .privacy { margin-top: 26px; }
}
@media (max-width: 520px) {
  .shell { width: calc(100% - 32px); }
  .top { min-height: 68px; }
  .brand { font-size: 21px; }
  .brand-mark, .brand-mark svg { width: 32px; height: 32px; }
  .top-note { font-size: 11px; }
  .intro { padding: 33px 0 28px; }
  .intro h1 { font-size: clamp(35px, 10vw, 44px); margin: 11px 0 12px; }
  .intro p { font-size: 14px; }
  .intro-guide { display: none; }
  .workspace { gap: 12px; }
  .devices-panel, .invite-panel { padding: 21px; }
  .panel-heading { align-items: start; }
  .room-tag { display: none; }
  .status { margin: 21px 0 14px; }
  .empty { min-height: 220px; }
  .device { flex-wrap: wrap; }
  .device .button { width: 100%; }
  .invite-panel h2 { font-size: 27px; }
  .history { margin-top: 30px; }
  .transfer-top { flex-direction: column; gap: 2px; }
  .transfer-top span { white-space: normal; }
  footer { flex-direction: column; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
