:root {
  color-scheme: light;
  font-family: system-ui, "Segoe UI", sans-serif;
  color: #172b41;
  background: #e9eef4;
  line-height: 1.5;
  --nav: #263a52;
  --edge: #c5d2e1;
  --muted: #465b73;
  --blue: #225ea9;
  --primary: #2468c0;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #164da3; outline-offset: 3px; }
.topbar :focus-visible { outline-color: #d4e8ff; }
strong, h1, h2 { line-height: 1.2; }
h1 { font-size: clamp(1.85rem, 5vw, 2.45rem); margin: 0 0 .8rem; letter-spacing: -.025em; }
h2 { font-size: 1.125rem; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }
button, input, textarea, select { font: inherit; }
a, dd, h1, p, small { overflow-wrap: anywhere; }
.topbar {
  background: var(--nav);
  color: #fff;
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 58px;
  padding: .5rem clamp(1rem, 2.1vw, 1.85rem);
}
.topbar a, .header-button { color: inherit; text-decoration: none; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-weight: 750; }
.mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 1px solid #6c8db0;
  border-radius: 4px;
  background: #3c5876;
  flex: none;
}
.mark::before, .mark::after { content: ""; position: absolute; }
.mark::before { inset: 6px 6px 10px; border: 2px solid white; border-radius: 1px; }
.mark::after { inset: 19px 9px 6px; border-bottom: 2px solid white; }
.product { border-left: 1px solid #71849b; padding-left: .9rem; font-weight: 650; font-size: .94rem; }
.topbar nav { display: flex; gap: .25rem; align-items: center; margin-left: auto; }
.topbar nav a, .header-button { padding: .4rem .65rem; border-radius: 4px; font-size: .9rem; font-weight: 650; }
.header-button { background: transparent; border: 0; cursor: pointer; }
.topbar nav a:hover, .header-button:hover { background: #3c5876; }
.skip { position: fixed; left: 1rem; top: 1rem; z-index: 2; transform: translateY(-150%); }
.skip:focus { transform: none; }
main { width: min(100% - 2rem, 1192px); margin: 1.5rem auto 3rem; }
main:focus:not(:focus-visible) { outline: none; }
main.wide { margin-top: clamp(1.5rem, 6vw, 4rem); }
.panel { min-width: 0; border: 1px solid var(--edge); border-radius: 5px; background: #fff; }
.hero { max-width: 890px; padding: clamp(1.2rem, 4vw, 2.3rem); }
.hero h1 { font-size: clamp(2rem, 5vw, 2.75rem); }
.hero p { color: var(--muted); font-size: 1.05rem; }
.hero .actions { margin-top: 1.5rem; }
.onboarding { margin-top: 2.25rem; }
.onboarding ol {
  padding: 1.25rem 0 0;
  border-top: 1px solid #b5c6d9;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  list-style: none;
}
.onboarding li + li { padding-left: 1.25rem; border-left: 1px solid var(--edge); }
.onboarding span { display: block; margin-top: .35rem; color: var(--muted); max-width: 30ch; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .45rem .85rem;
  gap: .35rem;
  text-decoration: none;
  min-height: 40px;
  border: 1px solid #aebccc;
  border-radius: 4px;
  background: #f5f7fa;
  color: #172b41;
  font-weight: 650;
  cursor: pointer;
  line-height: 1.3;
}
.button:hover { background: #e9eff7; }
.primary { background: var(--primary); border-color: #225ea9; color: white; }
.primary:hover { background: #1b569f; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.narrow { margin: 2.5rem auto 0; padding: clamp(1rem, 4vw, 2rem); max-width: 540px; }
.heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 1rem; }
.heading h1, .heading p { margin: 0; }
.space-name { color: var(--muted); font-weight: 650; }
.with-scopes { display: grid; grid-template-columns: minmax(190px, .84fr) minmax(0, 3fr); align-items: start; gap: 1rem; }
.scopes { padding: 1rem .65rem .65rem; }
.scopes h2 { margin-left: .6rem; }
.scopes ul, .order-list { margin: 0; padding: 0; list-style: none; }
.scope-link { display: block; padding: .55rem .6rem; border-radius: 3px; color: #172b41; text-decoration: none; }
.scope-link:hover { background: #f2f6fb; }
.scope-link[aria-current] { background: #e2ecfa; color: #124980; font-weight: 650; }
.scope-link small { display: block; color: var(--muted); font-weight: 400; }
.work { padding: clamp(.9rem, 2.2vw, 1.5rem); }
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(145px, .56fr) auto;
  align-items: end;
  gap: .65rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--edge);
}
label { display: block; font-weight: 650; }
input:not([type="hidden"]), textarea, select {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  margin-top: .25rem;
  padding: .4rem .65rem;
  border: 1px solid #8396ab;
  border-radius: 4px;
  background: white;
  color: inherit;
  font-weight: 400;
}
textarea { resize: vertical; }
.order-list li {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, .75fr) minmax(115px, .65fr);
  align-items: center;
  gap: .65rem;
  padding: .85rem 0;
  border-bottom: 1px solid #d9e2ee;
}
.order-list a { font-weight: 650; }
.order-id { display: block; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
time { color: var(--muted); font-size: .875rem; }
.badge { display: inline-block; border-radius: 3px; background: #e6eef9; color: #184f85; font-size: .79rem; font-weight: 650; padding: .18rem .48rem; }
.badge[data-status="completed"] { background: #e3f2e9; color: #1e5737; }
.badge[data-status="awaiting_customer"], .badge[data-status="result_review"] { background: #f8eedf; color: #7b4b12; }
.empty { padding: clamp(1.25rem, 4vw, 2.75rem) .35rem; }
.empty p { color: var(--muted); }
.pagination { margin-top: 1rem; }
.form-panel form { display: grid; gap: 1rem; }
.required, .field-error { color: #9c2632; }
.field-error { display: block; font-size: .875rem; }
[aria-invalid="true"] { border-color: #9c2632 !important; }
.notice { background: #eaf2fd; padding: .65rem .85rem; border-left: 3px solid #2d72d2; }
.notice.error { background: #fcebed; border-color: #ae3440; }
.notice p { margin: .25rem 0 0; }
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; gap: 1rem; }
.detail-materials { grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr); }
.order-column, .material-form { display: grid; gap: .85rem; min-width: 0; }
.material-heading, .chat-message > div {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .45rem;
}
.material-heading { border-bottom: 1px solid var(--edge); margin-bottom: .9rem; }
.material-heading h2 { margin-bottom: .6rem; }
.material-heading a { font-size: .88rem; }
.chat-list, .files-list { padding: 0; margin: 0 0 .9rem; list-style: none; }
.chat-list { display: grid; gap: .6rem; }
.chat-message { background: #edf3fa; border-radius: 4px; padding: .6rem .75rem; min-width: 0; }
.chat-message p { margin: .3rem 0 0; white-space: pre-wrap; }
.files-list li { border-bottom: 1px solid #d9e2ee; padding: .5rem 0; overflow-wrap: anywhere; }
.files-list small, .material-empty, .material-form small { color: var(--muted); }
.files-list small { margin-left: .35rem; }
.material-form fieldset { border: 1px solid var(--edge); min-width: 0; }
.file-choice { display: flex; align-items: baseline; gap: .45rem; overflow-wrap: anywhere; }
.file-choice input[type="checkbox"] { width: auto; min-height: 0; margin: 0; }
.resolution h3 { font-size: 1rem; margin-bottom: .35rem; }
.resolution form, .resolution details, .resolution .notice { margin-top: .9rem; }
.resolution summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.versions { display: flex; flex-wrap: wrap; gap: .65rem; list-style: none; padding: 0; }
.versions [aria-current="page"] { font-weight: 700; }
.review-comment { display: block; }
.queue-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 .8rem; border-bottom: 1px solid var(--edge); }
.queue-tabs a { padding: .4rem .65rem; font-weight: 600; }
.queue-tabs [aria-current="page"] { border-bottom: 2px solid var(--blue); }
.queue-list form { margin-top: .35rem; }
.detail h1 { margin-top: .6rem; }
.description { white-space: pre-wrap; }
.back { display: inline-block; margin-bottom: .35rem; font-weight: 650; }
dl { margin: 0; }
dl div { border-top: 1px solid #d9e2ee; padding: .55rem 0; }
dt { font-weight: 650; }
dd { margin: .1rem 0 0; color: var(--muted); }
.narrow form { margin-top: .75rem; }
@media (max-width: 690px) {
  .with-scopes, .detail, .onboarding ol { grid-template-columns: minmax(0, 1fr); }
  .onboarding li + li { padding: .7rem 0 0; border: 0; border-top: 1px solid var(--edge); }
  .topbar { flex-wrap: wrap; column-gap: .65rem; row-gap: .25rem; }
  .topbar nav { width: 100%; margin-left: -.35rem; flex-wrap: wrap; }
  .topbar nav a, .header-button { min-height: 40px; display: inline-flex; align-items: center; }
}
@media (max-width: 475px) {
  .filters, .order-list li { grid-template-columns: minmax(0, 1fr); }
  .order-list li { gap: .3rem; }
  .actions .button { max-width: 100%; }
}
