:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  color: #172d35;
  background: #f4f6f5;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.topbar { background: #12343b; color: white; }
.bar-inner, main { width: min(1480px, 100%); margin: 0 auto; padding-inline: clamp(18px, 4vw, 60px); }
.bar-inner, .identity, .heading, .device-heading { display: flex; align-items: center; }
.bar-inner { min-height: 62px; justify-content: space-between; gap: 16px; }
.brand { font-size: 22px; font-weight: 650; }
.brand span { color: #abe7dc; font-size: 15px; margin-left: 4px; }
.identity { gap: 12px; font-size: 14px; overflow-wrap: anywhere; }
.identity button { color: white; border-color: #77989c; background: transparent; }
main { padding-top: clamp(26px, 4vw, 56px); padding-bottom: 48px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); letter-spacing: .015em; line-height: 1.25; }
h2 { font-size: 20px; }
.heading { justify-content: space-between; gap: 16px; margin-bottom: 24px; }
button, input, select { font: inherit; }
button, input, select, .scope, .table-wrap, .login-card { border: 1px solid #c0ccca; border-radius: 7px; }
button { background: white; color: #173e43; cursor: pointer; padding: 8px 15px; min-height: 38px; font-weight: 600; }
button:hover { border-color: #29766d; }
button:disabled { opacity: .62; cursor: wait; }
:focus-visible { outline: 3px solid #168878; outline-offset: 3px; }
button.primary { background: #096e61; border-color: #096e61; color: white; }
input, select { width: 100%; min-height: 42px; background: #fff; color: #172d35; padding: 8px 10px; }
label, .field-label { display: block; font-size: 14px; font-weight: 650; margin-bottom: 6px; }
.login-card { width: min(100%, 420px); margin: 5vh auto 0; padding: 30px; background: white; }
.login-card h1 { font-size: 26px; margin-bottom: 20px; }
.login-card input { margin-bottom: 16px; }
.login-card button { width: 100%; margin-top: 6px; }
.scope { display: grid; grid-template-columns: minmax(170px, 2fr) minmax(170px, 2fr) minmax(100px, 1fr); gap: 18px; align-items: start; padding: 20px; background: white; }
.field-value { display: block; padding: 10px 0; font-weight: 500; }
.device-heading { gap: 12px; margin: 30px 0 12px; }
#device-count, .subtext, #empty-devices { color: #4d6468; }
.table-wrap { background: white; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
th, td { padding: 13px 14px; white-space: nowrap; border-bottom: 1px solid #dce2e1; vertical-align: top; }
th { background: #e9efed; color: #29494b; font-weight: 650; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f5f9f8; }
.subtext { display: block; font-size: 13px; margin-top: 2px; }
.active { color: #075a4b; font-weight: 650; }
.inactive { color: #7a510d; font-weight: 650; }
#empty-devices { padding: 28px 16px; }
#notice:not(:empty) { padding: 12px 15px; background: #fff4d9; color: #5d421b; border-left: 4px solid #a67922; margin-bottom: 18px; }
@media (max-width: 680px) {
  .scope { grid-template-columns: 1fr; gap: 12px; }
  .field-value { padding: 2px 0; }
  .heading { align-items: flex-start; }
  .login-card { padding: 22px; }
}

#workspace-nav, .tabs, .buttons, .facts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#workspace-nav, .tabs { border-bottom: 1px solid #baccc7; margin-bottom: 24px; gap: 12px; }
#workspace-nav button, .tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 10px 5px; color: #506662; }
#workspace-nav [aria-current="page"], .tabs [aria-current="page"] { border-color: #096e61; color: #075a4b; }
.filters { display: grid; grid-template-columns: minmax(200px, 2fr) 1fr 1fr auto; gap: 12px; margin-bottom: 18px; }
.filters input, .filters select { min-width: 0; }
#work-rows { border: 0; }
[data-action="open"] { border: 0; background: none; min-height: 0; padding: 0; color: #096e61; font-size: 16px; white-space: normal; text-align: left; overflow-wrap: anywhere; }
[data-action="open"]:hover { text-decoration: underline; }
.case-header { display: flex; justify-content: space-between; align-items: baseline; gap: 22px; flex-wrap: wrap; margin: 20px 0; overflow-wrap: anywhere; }
.case-header h1 { margin-block: 8px; }
.case-header strong { color: #09534b; font-size: 18px; }
.facts { gap: 12px 24px; padding: 14px 16px; margin: 18px 0; background: #e6efec; border-radius: 7px; color: #304e4a; font-size: 14px; }
.facts b { padding-inline-start: 4px; }
.muted, .empty, .timeline time { color: #526866; font-size: 14px; }
.empty { background: white; border: 1px solid #dce2e1; border-radius: 7px; padding: 32px 18px; text-align: center; }
.wrap { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.7; }
.timeline { margin: 0; padding: 0; }
.timeline li { list-style: none; display: grid; grid-template-columns: 230px minmax(0,1fr); gap: 14px; padding: 16px 4px; border-bottom: 1px solid #d3dfdc; }
.timeline p { margin-top: 5px; }
.requirement { background: white; border: 1px solid #d4dfdc; padding: 18px; margin: 12px 0; border-radius: 7px; }
.requirement h3 { font-size: 17px; margin: 0 0 12px; color: #075a4b; }
.requirement .buttons:not(:empty) { margin-top: 12px; }
.case-content > .buttons { margin-bottom: 14px; font-size: 15px; }
#work-editor { width: min(680px, calc(100% - 24px)); border: none; padding: clamp(16px,3vw,28px); border-radius: 12px; color: #172d35; }
#work-editor::backdrop { background: rgb(10 33 39 / 52%); }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; }
.fields .wide { grid-column: 1 / -1; }
.fields :is(select,input,textarea) { font-weight: 400; margin-top: 6px; }
.fields textarea { display: block; width: 100%; border: 1px solid #c0ccca; border-radius: 7px; font: inherit; font-weight: 400; resize: vertical; padding: 10px; }
#form-error { margin-block: 14px; color: #90421b; }
#entry .buttons { justify-content: flex-end; }
@media (max-width: 680px) {
  .fields, .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .filters { grid-template-columns: 1fr 1fr; }
  #workspace-nav, .tabs { gap: 4px; font-size: 14px; }
  #work-search, .filters button { grid-column: 1 / -1; }
}
.result-note { white-space: normal; min-width: 12em; max-width: 22em; }
.handoff { background: white; border-radius: 7px; border: 1px solid #d4dfdc; padding: 16px; margin: 14px 0; }
.handoff h2 { margin-bottom: 8px; font-size: 16px; }
.handoff p { line-height: 1.8; font-size: 14px; }
code { user-select: all; overflow-wrap: anywhere; font-size: 14px; color: #09534b; }
