:root {
  color-scheme: light;
  --ink: #171b1a;
  --muted: #68706d;
  --surface: #ffffff;
  --canvas: #eef1ef;
  --line: #d9dfdc;
  --line-strong: #b8c1bd;
  --primary: #1266dc;
  --primary-hover: #0d52b5;
  --success: #178653;
  --warning: #b96908;
  --danger: #ba2d35;
  --dark: #151918;
  --focus: #78aef5;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--canvas);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-bar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 10px clamp(16px, 4vw, 48px);
  color: #fff;
  background: var(--dark);
  border-bottom: 1px solid #2b3230;
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  object-fit: cover;
  border: 1px solid #3f4845;
  border-radius: 7px;
}

.brand span,
.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.3;
}

.brand small {
  margin-top: 2px;
  color: #aab4b0;
  font-size: 12px;
}

.device-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #cbd2cf;
  font-size: 13px;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.language-picker {
  position: relative;
  display: inline-flex;
}

.language-picker select {
  width: 116px;
  height: 34px;
  padding: 0 28px 0 10px;
  color: #f3f5f4;
  color-scheme: dark;
  background: #202624;
  border: 1px solid #46504d;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.language-picker select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #87908d;
  box-shadow: 0 0 0 3px rgb(135 144 141 / 15%);
}

.status-dot[data-state="online"] {
  background: #36c37d;
  box-shadow: 0 0 0 3px rgb(54 195 125 / 18%);
}

.status-dot[data-state="offline"] {
  background: #e77844;
  box-shadow: 0 0 0 3px rgb(231 120 68 / 18%);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  width: min(1100px, calc(100% - 32px));
  margin: 30px auto 48px;
}

.upload-tool,
.side-panel {
  min-width: 0;
}

.upload-tool {
  padding: clamp(20px, 4vw, 34px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 55px rgb(24 32 29 / 8%);
}

.tool-heading,
.section-heading,
.transfer-head,
.transfer-foot,
.action-row,
.file-row {
  display: flex;
  align-items: center;
}

.tool-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 750;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 4vw, 32px);
  line-height: 1.16;
}

h2 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.3;
}

.version {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.mode-tab {
  display: flex;
  min-width: 0;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.mode-tab:hover {
  border-color: var(--line-strong);
}

.mode-tab.is-active {
  background: #eef5ff;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.mode-tab:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.drop-zone:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.mode-mark,
.file-type,
.drop-type {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: #27302d;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
}

.mode-mark {
  width: 42px;
  height: 34px;
}

.mode-tab span:last-child,
.mode-tab strong,
.mode-tab small {
  display: block;
  min-width: 0;
}

.mode-tab strong {
  font-size: 14px;
}

.mode-tab small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.drop-zone {
  display: flex;
  min-height: 126px;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: #fafcfb;
  border: 1px dashed #aeb9b4;
  border-radius: 7px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging {
  background: #f0f6f3;
  border-color: var(--success);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.drop-type {
  width: 58px;
  height: 58px;
  background: var(--success);
  font-size: 13px;
}

.drop-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.drop-copy strong,
.drop-copy small {
  display: block;
}

.drop-copy strong {
  overflow-wrap: anywhere;
  font-size: 15px;
}

.drop-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.browse-label {
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--primary);
  background: #fff;
  border: 1px solid #b9cbea;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
}

.file-row {
  gap: 12px;
  min-height: 64px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-type {
  width: 44px;
  height: 34px;
  background: var(--primary);
}

.file-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.file-meta strong,
.file-meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta strong {
  font-size: 13px;
}

.file-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  font-size: 22px;
}

.icon-button:hover {
  color: var(--danger);
  background: #f8e9ea;
}

.transfer {
  margin-top: 24px;
  padding: 18px;
  background: #f7f9f8;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.transfer-head,
.transfer-foot {
  justify-content: space-between;
  gap: 16px;
}

.transfer-head {
  font-size: 13px;
  font-weight: 700;
}

.transfer-numbers {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  margin: 12px 0;
  overflow: hidden;
  background: #dce3df;
  border-radius: 4px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  transition: width 120ms linear;
}

.transfer[data-state="success"] .progress-track span {
  background: var(--success);
}

.transfer[data-state="error"] .progress-track span {
  background: var(--danger);
}

.transfer-foot {
  color: var(--muted);
  font-size: 11px;
}

.transfer-foot span:empty {
  display: none;
}

#elapsedTime {
  margin-left: auto;
}

.action-row {
  gap: 10px;
  margin-top: 18px;
}

.button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button-primary {
  min-width: 132px;
  color: #fff;
  background: var(--primary);
}

.button-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.button-danger {
  color: var(--danger);
  background: #fff;
  border-color: #dbaeb2;
}

.button-danger:hover:not(:disabled) {
  background: #fbedee;
}

.button-quiet {
  min-height: 30px;
  padding: 5px 10px;
  color: #fff;
  background: transparent;
  border-color: #46504d;
  font-size: 12px;
}

.button-quiet:hover:not(:disabled) {
  background: #262d2b;
}

.side-panel {
  align-self: start;
  padding: 6px 4px;
}

.device-panel,
.workflow {
  padding: 18px 0 22px;
  border-bottom: 1px solid var(--line-strong);
}

.device-panel {
  padding-top: 0;
}

.section-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.connection-badge {
  padding: 4px 8px;
  color: #626b68;
  background: #e3e8e5;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.connection-badge[data-state="online"] {
  color: #0d6840;
  background: #d8efe4;
}

.connection-badge[data-state="offline"] {
  color: #94451d;
  background: #fae6db;
}

.device-data {
  margin: 0;
}

.device-data div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid #dfe4e1;
}

.device-data dt,
.device-data dd {
  margin: 0;
  font-size: 12px;
}

.device-data dt {
  color: var(--muted);
}

.device-data dd {
  text-align: right;
  font-weight: 650;
}

.workflow h2 {
  margin-bottom: 16px;
}

.workflow ol {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.workflow li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
}

.workflow li > span {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: #fff;
  background: #77817d;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.workflow li.is-complete > span {
  background: var(--success);
}

.workflow li.is-current > span {
  background: var(--primary);
}

.workflow strong,
.workflow small {
  display: block;
}

.workflow strong {
  font-size: 13px;
}

.workflow small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.notice {
  margin-top: 18px;
  padding: 12px;
  color: #713f0e;
  background: #fff1da;
  border: 1px solid #edcf9c;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.55;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 12px 14px;
  color: #fff;
  background: #222826;
  border: 1px solid #3d4744;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgb(20 26 24 / 24%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
  font-size: 12px;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .app-bar {
    position: static;
  }

  .device-summary > span:not(.status-dot) {
    display: none;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin-top: 18px;
  }

  .side-panel {
    padding: 0 4px;
  }
}

@media (max-width: 560px) {
  .app-bar {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 14px;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid #303835;
  }

  .language-picker select {
    width: 124px;
  }

  .brand img {
    width: 40px;
    height: 40px;
  }

  .brand small {
    max-width: 190px;
    white-space: normal;
  }

  .workspace {
    width: min(100% - 20px, 1100px);
  }

  .upload-tool {
    padding: 18px 14px;
  }

  .mode-tabs {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 150px;
    flex-wrap: wrap;
    padding: 18px;
  }

  .drop-copy {
    flex-basis: calc(100% - 78px);
  }

  .browse-label {
    width: 100%;
    text-align: center;
  }

  .action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .button-primary {
    min-width: 0;
  }

  .transfer-foot {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.community-file{display:grid;gap:5px;margin-block:0 18px;padding:16px;border:1px solid #d5dcd8;border-radius:8px;background:#f4f7f5}
.community-file p,.workflow-note{margin:0;color:#44504a}
.community-file button{justify-self:start}
.flash-check{display:flex;align-items:baseline;gap:8px;margin-block:12px}
.flash-check input{flex:none}
.workflow-note{margin-block:0 12px}
.workflow li>div{min-width:0}
.workflow select{max-width:100%;width:100%;display:block;margin-block:8px;padding:8px;color:inherit;background:#fff;border:1px solid #cbd4ce;border-radius:6px}
.workflow-support{display:inline-block;margin-top:8px;color:#094a9e;text-decoration:underline}
.workflow .flash-warning{margin-top:8px;color:#7c430c}
.transfer[data-state=uploading] .progress-track span{width:33%;animation:upload-wait 1.7s linear infinite}
@keyframes upload-wait{from{transform:translateX(-100%)}to{transform:translateX(303%)}}
@media(prefers-reduced-motion:reduce){.transfer[data-state=uploading] .progress-track span{animation:none}}
