:root {
  color-scheme: light;
  --ink: #191d31;
  --muted: #535e75;
  --line: #dce1ed;
  --navy: #232b5b;
  --blue: #323f8e;
  --blue-soft: #e9edff;
  --paper: #fff;
  --canvas: #f5f6fa;
  font: 16px/1.55 "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid #367bcc; outline-offset: 3px;
}
.skip { position: absolute; transform: translateY(-140%); z-index: 5; background: white; padding: .5rem 1rem; }
.skip:focus { transform: none; }
.header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.bar, #main { width: min(1180px, calc(100% - 80px)); margin: auto; }
.bar,.brand,.nav-links,.actions,.top-actions,.heading-row,.tabs { display: flex; align-items: center; }
.bar { justify-content: space-between; gap: 12px; min-height: 68px; }
.brand { gap: 11px; font-size: 1.1rem; font-weight: 720; white-space: nowrap; letter-spacing: -.04em; }
.brand b { font-weight: 520; }
.brand-logo { display: block; width: 28px; height: 28px; }
.nav-links { gap: 24px; font-size: .9rem; font-weight: 550; }
.nav-links a:hover,.text-btn:hover { color: var(--blue); text-decoration: underline; }
.contact,.btn,.tab,.text-btn { border: 0; background: transparent; }
.contact { background: var(--ink); color: white; border-radius: 999px; padding: 7px 17px; font-size: .88rem; }
#main { padding: clamp(20px,3vw,40px) 0 84px; outline: none; }
.loading,.empty,.auth-foot,.muted,.time { color: var(--muted); }
h1,h2,h3,h4,p { margin: 0; }
h1 { font-size: clamp(2.1rem,3.9vw,3.55rem); letter-spacing: -.07em; line-height: 1.13; font-weight: 650; }
h2 { font-size: clamp(1.25rem,1.8vw,1.6rem); font-weight: 650; line-height: 1.35; letter-spacing: -.032em; }
h3 { font-size: 1.12rem; letter-spacing: -.025em; }
h4 { font-size: 1rem; }
.heading-row, .auth-intro {
  position: relative;
  isolation: isolate;
  color: white;
  overflow: hidden;
  background-color: #1c2650;
  background-image:
    linear-gradient(90deg,#adc0ff0a 1px,transparent 1px),
    linear-gradient(0deg,#adc0ff0a 1px,transparent 1px),
    linear-gradient(115deg,#111831 5%,#242f60 65%,#344584 100%);
  background-size: 24px 24px,24px 24px,cover;
}
.heading-row::before, .auth-intro::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20450%20170%22%20fill%3D%22none%22%3E%3Cg%20stroke%3D%22%23929de7%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M8%20145h49l36-36h50l26-26h66M40%20157h37l38-38h36l23-23h63M112%2052h24l13%2013h57l26-26h34M199%2015h42l14%2014h36M353%2038h30l18-18h44M354%2094h24l28%2028h50M321%20123v16l32%2032M280%20124v19l-26%2026h-58M355%2078h46l13-13h36%22%2F%3E%3Crect%20x%3D%22252%22%20y%3D%2232%22%20width%3D%2299%22%20height%3D%2294%22%20rx%3D%2215%22%2F%3E%3Crect%20x%3D%22268%22%20y%3D%2247%22%20width%3D%2267%22%20height%3D%2264%22%20rx%3D%228%22%2F%3E%3Cpath%20d%3D%22M264%2025v7m12-7v7m12-7v7m12-7v7m12-7v7m12-7v7m12-7v7M264%20126v8m12-8v8m12-8v8m12-8v8m12-8v8m12-8v8m12-8v8M245%2045h7m-7%2012h7m-7%2012h7m-7%2012h7m-7%2012h7m-7%2012h7M351%2045h7m-7%2012h7m-7%2012h7m-7%2012h7m-7%2012h7m-7%2012h7%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22%23eed39a%22%3E%3Ccircle%20cx%3D%228%22%20cy%3D%22145%22%20r%3D%222.6%22%2F%3E%3Ccircle%20cx%3D%22112%22%20cy%3D%2252%22%20r%3D%222.5%22%2F%3E%3Ccircle%20cx%3D%22199%22%20cy%3D%2215%22%20r%3D%222.5%22%2F%3E%3Ccircle%20cx%3D%22401%22%20cy%3D%2220%22%20r%3D%222.4%22%2F%3E%3Ccircle%20cx%3D%22406%22%20cy%3D%22122%22%20r%3D%222.4%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E") right center / auto 105% no-repeat;
  opacity: .64;
}
.heading-row { justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 24px; border: 1px solid #263665; border-radius: 21px; padding: clamp(22px,3.2vw,42px); }
.heading-row > div:first-child { min-width: 0; }
.heading-row .btn.primary { background: #f2cf7e; color: #382a14; }
.heading-row .btn.primary:hover { background: #ffe3a1; }
.heading-row .btn.secondary { background: #152045dc; color: #f4f6ff; border-color: #7886b2; }
.heading-row .btn.secondary:hover { background: #283765; border-color: #b3bee7; }
.heading-row .top-actions { flex-shrink: 0; }
.heading-row p { margin-top: .55rem; overflow-wrap: anywhere; color: #d9dff5; }
.top-actions,.actions { gap: 9px; flex-wrap: wrap; }
.btn { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 17px; font-weight: 600; font-size: .92rem; border-radius: 10px; text-align: center; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover,.contact:hover { background: #394889; }
.btn.secondary { border: 1px solid #ccd5df; background: white; color: var(--ink); }
.btn.secondary:hover { background: #f2f6fa; border-color: #9bacbe; }
.text-btn { padding: 4px 1px; font-weight: 550; color: var(--blue); font-size: .9rem; }
.box { border: 1px solid var(--line); border-radius: 19px; background: var(--paper); overflow: hidden; }
.box-pad { padding: clamp(19px,2.65vw,36px); }
.auth-grid { display: grid; max-width: 980px; margin: 16px auto 0; grid-template-columns: 1.1fr 1fr; background: white; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
.auth-intro { padding: clamp(28px,4.1vw,58px); display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.auth-intro::before { background-size: 82% auto; background-position: right top; opacity: .53; }
.auth-intro h1 { font-size: clamp(2.4rem,5vw,3.9rem); }
.auth-intro p { color: #d8e5ee; max-width: 23em; }
.auth-body { padding: clamp(26px,3.4vw,50px); align-self: center; }
.auth-body h2 { margin-bottom: 24px; }
.auth-foot { margin-top: 17px; font-size: .9rem; }
.form { display: grid; gap: 15px; }
.label { display: grid; gap: 5px; font-size: .91rem; font-weight: 600; }
input,select,textarea { display: block; width: 100%; min-width: 0; min-height: 43px; padding: 9px 11px; color: var(--ink); background: white; border: 1px solid #becbd6; border-radius: 8px; }
textarea { resize: vertical; }
::placeholder { color: #768496; font-weight: 400; }
.hint,.time { font-size: .86rem; font-weight: 400; }
.hint { color: var(--muted); }
.form-error { color: #9b2323; font-size: .93rem; overflow-wrap: anywhere; }
.form-error:empty { display: none; }
.workspace { display: grid; grid-template-columns: minmax(250px,.76fr) minmax(0,1.64fr); gap: 20px; align-items: start; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.count { font-size: .85rem; color: var(--muted); margin-left: .25em; }
.list { display: grid; }
.order-row { display: grid; width: 100%; text-align: left; gap: 5px; padding: 17px 21px; border: 0; border-bottom: 1px solid var(--line); background: white; color: var(--ink); box-shadow: inset 3px 0 transparent; }
.order-row:last-child { border-bottom: 0; }
[data-mode="rent"] {
  --mode-ink: #2d3e87;
  --mode-stroke: #6374c2;
  --mode-wash: #eef1fd;
  --mode-edge: #d7def6;
}
[data-mode="own"] {
  --mode-ink: #70470b;
  --mode-stroke: #b88832;
  --mode-wash: #fff6e3;
  --mode-edge: #eddbb5;
}
.order-row:hover { background: #f5f6fb; }
.order-row[aria-pressed="true"] { background: var(--mode-wash); box-shadow: inset 3px 0 var(--mode-stroke); }
.order-row .mode-label { font-weight: 650; color: var(--mode-ink); }

.line,.spec { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.line { flex-wrap: wrap; }
.line strong { font-weight: 650; }
.dim,.id { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.02em; }
.pill { display: inline-flex; align-items: center; width: fit-content; padding: 3px 9px; font-size: .79rem; line-height: 1.45; border-radius: 20px; font-weight: 610; background: #edf1f5; color: #3c5061; white-space: nowrap; }
.pill.review,.pill.paid { background: #fff1d8; color: #724512; }
.pill.active,.pill.available { background: #e2f3eb; color: #1a6147; }
.pill.expired { background: #f1e8e2; color: #755038; }
.empty { padding: 16px 0; }
.empty p + a { margin-top: 14px; }
.detail { display: grid; gap: 22px; }
.detail .detail-header {
  --inset: clamp(19px,2.65vw,36px);
  padding: var(--inset);
  margin: calc(0px - var(--inset)) calc(0px - var(--inset)) 0;
  color: var(--mode-ink);
  border-bottom: 1px solid var(--mode-edge);
  background: linear-gradient(105deg,var(--mode-wash) 25%,#fff 100%);
}
.detail-header > div { min-width: 0; }
.detail .detail-header .text-btn { color: var(--mode-ink); }

.detail-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detail-header .dim { margin-top: 4px; }
.specs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 26px; margin: 0; }
.spec { align-items: flex-start; border-top: 1px solid var(--line); padding: 11px 0; flex-wrap: wrap; }
.spec dt { font-size: .88rem; color: var(--muted); }
.spec dd { margin: 0; font-weight: 580; text-align: right; overflow-wrap: anywhere; word-break: break-word; }
.task { border-radius: 13px; border: 1px solid #dce1ec; background: #f6f7fb; padding: 18px 20px; display: grid; gap: 12px; }
.task p { overflow-wrap: anywhere; }
.task .btn { justify-self: start; }
.task .form { max-width: 440px; }
.credentials { background: #152535; color: #f1f7fd; font: .91rem/1.65 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; overflow-wrap: anywhere; border-radius: 9px; padding: 14px; margin: 0; }
.lease-progress { height: 7px; width: 100%; accent-color: var(--mode-stroke,var(--blue)); }
.tabs { gap: 6px; margin: 0 0 22px; flex-wrap: wrap; }
.tab { color: var(--muted); padding: 8px 17px; border: 1px solid var(--line); background: white; font-weight: 580; border-radius: 99px; }
.tab[aria-pressed="true"] { background: var(--navy); color: white; border-color: var(--navy); }
.inventory { display: grid; gap: 20px; grid-template-columns: minmax(0,1.15fr) minmax(0,.85fr); align-items: start; }
.device-list { list-style: none; margin: 0; padding: 0; }
.device-list li { border-bottom: 1px solid var(--line); padding: 15px 21px; }
.device-list li:last-child { border-bottom: none; }
.inventory h2 + .form { margin-top: 17px; }
.notice { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); background: var(--navy); padding: 10px 17px; border-radius: 10px; color:white; box-shadow: 0 6px 24px #10233520; z-index: 20; font-size: .9rem; }
.notice:empty { display: none; }
@media(max-width:800px) {
  .bar,#main { width: calc(100% - 38px); }
  .workspace,.inventory { grid-template-columns: 1fr; }
  .list { max-height: 280px; overflow-y: auto; }
  .heading-row { align-items: flex-start; flex-direction: column; margin-bottom: 20px; }
  .auth-grid { grid-template-columns: .85fr 1fr; }
}
@media(max-width:570px) {
  .bar { min-height: 59px; }
  .brand { font-size: .94rem; gap: 7px; }
  .brand-logo { width: 23px; height: 23px; }
  .nav-links { gap: 10px; font-size: .82rem; }
  .nav-links a:first-child { display: none; }
  .contact { font-size: .8rem; padding: 6px 11px; }
  .auth-grid { grid-template-columns: 1fr; margin-top: 0; }
  .auth-intro { gap: 8px; padding: 26px; }
  .auth-intro::before { background-size: 62% auto; opacity: .45; }
  .heading-row::before { background-size: 86% auto; background-position: right -30px top 8px; opacity: .48; }
  .auth-intro h1 { font-size: 2.1rem; }
  .auth-body { padding: 25px; }
  .specs { grid-template-columns: 1fr; }
  .task { padding: 15px; }
  .order-row { padding: 11px 15px; }
  .section-head { padding: 14px 16px; }
}
@media(prefers-reduced-motion: no-preference) {
  button,a { transition: background-color .15s ease,color .15s ease,border-color .15s ease; }
}

.confirm { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.confirm input { width: 17px; height: 17px; min-height: 0; flex-shrink: 0; margin: 3px 0 0; accent-color: var(--blue); }

.settings { display: grid; gap: 22px; max-width: 960px; }
.intro-hint { margin-top: 5px; }
.settings-categories { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.settings-category { border: 1px solid transparent; background: transparent; color: var(--muted); padding: 7px 12px; border-radius: 9px; font-size: .91rem; font-weight: 600; }
.settings-category:hover { color: var(--navy); background: #f5f6fb; }
.settings-category[aria-pressed="true"] { border-color: #d6def1; background: #edf0fb; color: var(--navy); }
.settings-fields { display: grid; gap: 12px; margin: 0; border: 0; padding: 0; min-inline-size: 0; }
.settings-fields h3 + .hint { margin-top: -5px; }
.mode-grid,.input-pair,.input-triple { display: grid; gap: 13px; }
.mode-grid,.input-pair { grid-template-columns: repeat(2,minmax(0,1fr)); }
.input-triple { grid-template-columns: repeat(3,minmax(0,1fr)); }
.price-mode,.product-form { min-width: 0; border: 1px solid var(--mode-edge); background: var(--mode-wash); border-radius: 12px; padding: clamp(13px,1.8vw,20px); display: grid; gap: 12px; }
.price-mode h4,.product-form h4,.product-form .quote { color: var(--mode-ink); }
.surcharge { margin-top: 7px; }
.surcharge .hint { margin: 3px 0 10px; }
.savebar { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 14px; display: flex; align-items: center; gap: 13px; flex-wrap: wrap; }
.savebar button:disabled { cursor: default; opacity: .53; }
.settings-notice:has(.conflict),.settings-notice:has(.form-error:not(:empty)) { margin-top: 15px; }
.conflict { background: #fff5e4; color: #744916; border: 1px solid #e5cea2; border-radius: 11px; padding: 13px; }
.conflict p { margin: 5px 0 8px; }
.settings input,.settings select { font-weight: 450; }
@media(max-width:690px) {
  .mode-grid { grid-template-columns: 1fr; }
}
@media(max-width:510px) {
  .settings { gap: 15px; }
  .settings-category { padding: 6px 7px; }
  .input-triple { grid-template-columns: 1fr; gap: 9px; }
  .mode-grid,.input-pair { gap: 8px; }
}
