:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #15251f;
  background: #f6f7f3;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; background: #f6f7f3; }

button, input { font: inherit; }

button { cursor: pointer; }

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid #dfb74c;
  outline-offset: 2px;
}

.shell { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 56px; }

.topbar {
  height: 72px;
  border-bottom: 1px solid #d9ded7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { color: #1f6f63; font-size: 21px; font-weight: 760; letter-spacing: 0; text-decoration: none; }
.header-actions { display: flex; gap: 8px; }

.text-button, .small-button, .danger-button, .primary-button, .icon-button {
  border: 1px solid transparent;
  border-radius: 6px;
  min-height: 36px;
  padding: 0 12px;
  background: transparent;
  color: #234138;
}

.text-button:hover, .small-button:hover { background: #e8eeea; }
.primary-button { background: #1f6f63; color: #fff; border-color: #1f6f63; }
.primary-button:hover { background: #18594f; }
.danger-button { color: #a33a32; }
.danger-button:hover { background: #f9e8e5; }
.icon-button { width: 36px; padding: 0; font-size: 25px; line-height: 1; }

.access-view { max-width: 480px; margin: 88px auto 0; }
.access-card { border-top: 3px solid #1f6f63; padding: 28px 0; }
.access-card h1 { margin: 0 0 8px; font-size: 25px; letter-spacing: 0; }
.access-card p { margin: 0 0 24px; color: #56665f; line-height: 1.55; }

.stack-form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; color: #405149; font-size: 14px; font-weight: 650; }
.field input, .inline-form input {
  min-height: 44px;
  border: 1px solid #bac5bc;
  border-radius: 5px;
  background: #fff;
  color: #15251f;
  padding: 0 12px;
}
.field input::placeholder, .inline-form input::placeholder { color: #84918a; }
.form-feedback { min-height: 20px; margin: 0; color: #a33a32; font-size: 14px; }
.form-feedback.success { color: #17614b; }

.workspace-heading {
  padding: 42px 0 20px;
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
}
.eyebrow { margin: 0 0 5px; color: #5e7168; font-size: 14px; }
h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
h2, h3 { margin: 0; letter-spacing: 0; }
.capacity { width: min(260px, 42vw); color: #4c5d54; font-size: 13px; text-align: right; }
.capacity-track { height: 5px; margin-top: 8px; overflow: hidden; background: #d9e2dc; border-radius: 2px; }
.capacity-track span { display: block; height: 100%; width: 0; background: #d49b2c; transition: width 180ms ease; }

.dropzone {
  position: relative;
  min-height: 174px;
  border: 1px dashed #7f968a;
  border-radius: 7px;
  background: #edf3ee;
  display: grid;
  place-items: center;
  transition: background 150ms ease, border-color 150ms ease;
}
.dropzone.dragging { background: #dcebe0; border-color: #1f6f63; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-content { display: grid; gap: 5px; text-align: center; pointer-events: none; }
.dropzone-content strong { font-size: 18px; }
.dropzone-content span { color: #5d7066; font-size: 14px; }

.uploads-panel, .files-section { margin-top: 30px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-heading h2 { font-size: 17px; }
.muted, .file-meta { color: #64746b; font-size: 13px; }
.files-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.upload-item { padding: 12px 0; border-top: 1px solid #d9ded7; }
.upload-copy { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-progress { height: 4px; margin-top: 8px; overflow: hidden; background: #dfe6e0; border-radius: 2px; }
.upload-progress span { display: block; height: 100%; background: #1f6f63; }

.files-list { border-top: 1px solid #cfd7d0; }
.file-row { min-height: 68px; border-bottom: 1px solid #d9ded7; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.selection-control { display: grid; flex: 0 0 20px; place-items: center; }
.selection-control input { width: 17px; height: 17px; margin: 0; accent-color: #1f6f63; }
.file-main { min-width: 0; display: grid; gap: 5px; color: inherit; text-decoration: none; }
.file-main:hover .file-name { color: #1f6f63; text-decoration: underline; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.file-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.small-button, .danger-button { min-height: 32px; padding: 0 9px; font-size: 13px; }
.empty-state { border-top: 1px solid #cfd7d0; padding: 32px 0; color: #64746b; text-align: center; }

dialog { width: min(500px, calc(100% - 32px)); border: 1px solid #cbd5cc; border-radius: 7px; padding: 0; color: #15251f; background: #fbfcf9; box-shadow: 0 18px 48px rgb(29 45 35 / 20%); }
dialog::backdrop { background: rgb(21 37 31 / 38%); }
.dialog-header { height: 62px; padding: 0 16px 0 20px; border-bottom: 1px solid #d9ded7; display: flex; align-items: center; justify-content: space-between; }
.dialog-header h2 { font-size: 19px; }
.device-list { max-height: 260px; overflow-y: auto; }
.device-row { padding: 14px 20px; border-bottom: 1px solid #e1e6e1; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.device-copy { min-width: 0; display: grid; gap: 4px; }
.device-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-meta { color: #64746b; font-size: 13px; }
.pair-section { padding: 20px; }
.pair-section h3 { font-size: 15px; margin-bottom: 12px; }
.inline-form { display: flex; gap: 8px; }
.inline-form input { min-width: 0; flex: 1; text-transform: uppercase; }

.pair-code { margin: 20px 0; padding: 16px; border: 1px solid #cbd8ce; border-radius: 6px; color: #1f6f63; background: #edf5ee; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 24px; font-weight: 750; letter-spacing: 1px; text-align: center; }
.small-note { color: #627169; font-size: 13px; line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 580px) {
  .shell { width: min(100% - 24px, 960px); }
  .topbar { height: 62px; }
  .workspace-heading { padding-top: 28px; align-items: flex-start; flex-direction: column; gap: 15px; }
  .capacity { width: 100%; text-align: left; }
  .file-row { align-items: flex-start; flex-direction: column; gap: 10px; padding: 13px 0; }
  .selection-control { align-self: flex-start; }
  .file-actions { width: 100%; justify-content: flex-end; }
  .files-toolbar { flex-wrap: wrap; }
  .access-view { margin-top: 52px; }
}
