:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: #eef3f4;
  background: #0b0e0f;
  --surface: #171c1e;
  --surface-raised: #1d2326;
  --line: #3b464a;
  --muted: #9aa7ac;
  --cyan: #54c9ec;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: #0b0e0f; }

body {
  min-height: 100vh;
  margin: 0;
  background: #101416;
  color: #eef3f4;
}

button,
input { font: inherit; }

.device-header {
  min-height: 76px;
  padding: 11px max(20px, calc((100vw - 980px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: #080a0b;
  border-bottom: 1px solid #30383b;
}

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

.device-brand img {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  object-fit: contain;
}

.device-brand span { min-width: 0; }

.device-brand small,
.section-kicker,
.tool-heading small {
  display: block;
  color: #8e9a9f;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0;
}

.device-brand strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  line-height: 1.25;
}

.device-security {
  min-height: 30px;
  padding: 6px 9px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #2f788e;
  border-radius: 5px;
  background: #10262d;
  color: #9de4f5;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.device-main {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto;
  padding: 62px 0 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 54px;
  align-items: center;
}

.device-intro h1 {
  margin: 8px 0 14px;
  font-size: 38px;
  line-height: 1.25;
  letter-spacing: 0;
}

.device-intro > p {
  max-width: 560px;
  margin: 0;
  color: #b9c3c6;
  font-size: 14px;
  line-height: 1.8;
}

.device-intro > .device-recipient {
  max-width: 560px;
  margin-top: 17px;
  padding: 11px 13px;
  border-left: 3px solid var(--cyan);
  background: #10242a;
  color: #d7f3f9;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.55;
}

.device-steps {
  margin: 31px 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  list-style: none;
  border-top: 1px solid #333c3f;
  border-bottom: 1px solid #333c3f;
}

.device-steps li {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid #283033;
}

.device-steps li:last-child { border-bottom: 0; }

.device-steps li span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #438ba0;
  border-radius: 50%;
  color: #a7e7f6;
  font-size: 12px;
  font-weight: 900;
}

.device-steps strong { font-size: 13px; }

.workspace-link {
  margin-top: 18px;
  display: inline-flex;
  min-height: 43px;
  padding: 10px 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid #438ba0;
  border-radius: 6px;
  background: #10262d;
  color: #b8edfa;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.workspace-link[aria-disabled="true"] {
  border-color: #475256;
  background: #242a2c;
  color: #7f8a8e;
  cursor: wait;
}

.device-intro > .workspace-link-help {
  margin-top: 9px;
  color: #929fa4;
  font-size: 11px;
  line-height: 1.6;
}

.device-tool {
  min-width: 0;
  padding: 27px;
  border: 1px solid #485459;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.tool-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-heading h2 {
  margin: 3px 0 0;
  font-size: 21px;
  letter-spacing: 0;
}

.tool-marker {
  width: 7px;
  height: 46px;
  border-radius: 3px;
  background: var(--cyan);
}

.device-request-form {
  margin-top: 25px;
}

.device-request-form label {
  display: block;
  margin-bottom: 8px;
  color: #d8e0e2;
  font-size: 12px;
  font-weight: 850;
}

.device-request-form input {
  width: 100%;
  min-height: 50px;
  padding: 10px 12px;
  border: 1px solid #859398;
  border-radius: 5px;
  background: #f8fafb;
  color: #142126;
  color-scheme: light;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0;
}

.device-request-form input:focus {
  outline: 3px solid rgba(84, 201, 236, 0.3);
  border-color: #199dc4;
}

#devicePasswordFields input { margin-bottom: 16px; }
.device-cancel { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }

.device-request-form > p {
  margin: 8px 0 0;
  color: #9aa7ac;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.55;
}

.device-code-fields {
  min-width: 0;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  border: 0;
}

.device-code-fields input {
  width: 100%;
  min-width: 0;
  aspect-ratio: 0.82;
  max-height: 62px;
  padding: 4px;
  border: 1px solid #859398;
  border-radius: 5px;
  background: #f8fafb;
  color: #142126;
  color-scheme: light;
  font-size: 25px;
  font-weight: 850;
  text-align: center;
  letter-spacing: 0;
}

.device-code-fields input:focus {
  outline: 3px solid rgba(84, 201, 236, 0.3);
  border-color: #199dc4;
}

.device-code-note {
  margin: 10px 0 0;
  color: #aeb9bd;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.55;
}

.device-status {
  min-height: 42px;
  margin: 18px 0 0;
  padding: 10px 11px;
  border-left: 3px solid #4da7c1;
  background: #10242a;
  color: #c6eaf3;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.55;
}

.device-status[data-state="error"] {
  border-left-color: #dc7373;
  background: #2b1919;
  color: #ffc8c8;
}

.device-status[data-state="success"] {
  border-left-color: #73bd88;
  background: #14271a;
  color: #c5edcf;
}

.device-timer {
  min-height: 20px;
  margin: 8px 0 0;
  color: #9aa7ac;
  font-size: 10px;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid #2e8ca9;
  border-radius: 6px;
  background: #1688ad;
  color: #fff;
  font-weight: 850;
  cursor: pointer;
}

.primary-action:disabled {
  border-color: #485256;
  background: #30373a;
  color: #899499;
  cursor: not-allowed;
}

.device-actions {
  margin-top: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-actions button,
.device-actions a {
  min-height: 36px;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: #aab5b9;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.device-cancel {
  margin-top: 8px;
  text-align: right;
}

.device-cancel a {
  color: #9da9ad;
  font-size: 10px;
  font-weight: 800;
}

.device-footer {
  width: min(980px, calc(100% - 40px));
  min-height: 50px;
  margin: 0 auto;
  padding: 15px 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid #30383b;
  color: #7f8a8f;
  font-size: 10px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .device-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
    padding-top: 34px;
  }

  .device-intro h1 { font-size: 29px; }
}

@media (max-width: 440px) {
  .device-header { padding: 10px 13px; }
  .device-security { display: none; }
  .device-main,
  .device-footer { width: calc(100% - 26px); }
  .device-tool { padding: 21px 15px; }
  .device-code-fields { gap: 5px; }
  .device-code-fields input { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
