/* Hallmark · theme: House Signal (Pusk Impuls reference) · genre: modern-minimal · shape: app screen · signature: graphite ledger, coral intake */
/* Critique: spend the strong color on the next action. Keep descriptions and files on quiet surfaces. */
@font-face {
  font-family: Geologica;
  src: url('/requests/geologica-33c7fa548616.woff2') format('woff2');
  font-style: normal; font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Geologica;
  src: url('/requests/geologica-25d318ff543c.woff2') format('woff2');
  font-style: normal; font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FFFD;
}
@font-face {
  font-family: Onest;
  src: url('/requests/onest-10fd3c6f16a5.woff2') format('woff2');
  font-style: normal; font-weight: 400 700; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: Onest;
  src: url('/requests/onest-a1981c57f2b7.woff2') format('woff2');
  font-style: normal; font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FFFD;
}
:root {
  --paper: #f2f4f6;
  --surface: #fdfdfe;
  --mist: #e9edf1;
  --line: #d6dfe7;
  --field-border: #74808d;
  --ink: #202730;
  --muted: #536271;
  --deep: #222931;
  --deep-hover: #364352;
  --mast-text: #ffffff;
  --mast-muted: #ccd6e1;
  --shell-rule: #48535f;
  --accent: #d8322d;
  --accent-wash: #fce9e6;
  --accent-ink: #ffffff;
  --action: #c32f2a;
  --action-hover: #a62622;
  --focus: #a62622;
  --focus-on-dark: #ffb1a9;
  --soft-green: #e4f1e9;
  --soft-green-text: #20533b;
  --soft-blue: #e1ebf5;
  --soft-blue-text: #284e6a;
  --soft-amber: #f7ecd7;
  --soft-amber-text: #644b20;
  --soft-red: #fbe6e3;
  --soft-red-text: #912b26;
  --disabled: #e9edf1;
  --disabled-text: #485564;
  --shadow: 0 16px 42px #22293128;
  --overlay: #22293166;
  --font: Onest, "Segoe UI", system-ui, sans-serif;
  --font-display: Geologica, Onest, "Segoe UI", system-ui, sans-serif;
  --radius: 15px;
  --small-radius: 8px;
  --dur-micro: 150ms;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.5;
}
[hidden] { display: none !important; }
a { color: var(--deep); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--accent-wash); color: var(--ink); }

.frame { width: min(100% - 3rem, 82rem); margin-inline: auto; }
.masthead { background: var(--deep); color: var(--mast-text); border-bottom: 1px solid var(--shell-rule); }
.masthead-inner { display: flex; min-height: 4.65rem; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead :focus-visible { outline-color: var(--focus-on-dark); }
.brand { display: flex; align-items: center; gap: .85rem; min-width: 0; color: inherit; text-decoration: none; }
.brand-mark { width: 2.5rem; height: 2.5rem; flex-shrink: 0; color: var(--accent); }
.brand-copy { display: grid; line-height: 1.2; gap: .25rem; }
.brand-copy strong { font: 650 1.125rem/1.15 var(--font-display); letter-spacing: -.025em; }
.brand-copy span { font-size: .8125rem; color: var(--mast-muted); }
.masthead nav { display: flex; align-items: stretch; align-self: stretch; gap: 1.5rem; }
.masthead nav a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  text-decoration: none;
  color: var(--mast-muted);
}
.masthead nav a[aria-current], .masthead nav a:hover { color: var(--mast-text); border-color: var(--accent); }
.masthead .signout { align-self: center; color: var(--mast-muted); background: transparent; border-color: transparent; }
.masthead .signout:hover:not(:disabled) { color: var(--mast-text); background: var(--deep-hover); }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-block: 2.2rem 1.65rem; }
h1, h2 { margin: 0; font-family: var(--font-display); line-height: 1.15; min-width: 0; overflow-wrap: break-word; text-wrap: balance; }
h1 { font-size: 2.5rem; letter-spacing: -.04em; font-weight: 700; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
.page-heading p { margin: .5rem 0 0; color: var(--muted); }

.workspace { display: grid; grid-template-columns: minmax(0, 2fr) minmax(19rem, 1fr); gap: 1rem; align-items: start; }
.queue, .intake { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.queue-heading, .intake-heading { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.queue-heading { padding: 1rem 1.25rem .75rem; }
.intake { padding: 1.15rem; }
.intake-heading { padding-bottom: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }

button, input, select, textarea { font: inherit; }
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: var(--small-radius);
  padding: .42rem .8rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 600;
  line-height: 1.2;
  transition: background-color var(--dur-micro), border-color var(--dur-micro), color var(--dur-micro);
}
button svg { width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
button:hover:not(:disabled) { background: var(--mist); border-color: var(--muted); }
button:active:not(:disabled) { background: var(--accent-wash); }
button.primary { background: var(--action); border-color: var(--action); color: var(--accent-ink); min-height: 2.75rem; }
button.primary:hover:not(:disabled), button.primary:active:not(:disabled) { background: var(--action-hover); border-color: var(--action-hover); }
button.quiet { background: transparent; border-color: transparent; color: var(--deep); }
button:disabled, button.primary:disabled, button.quiet:disabled { background: var(--disabled); border-color: var(--disabled); color: var(--disabled-text); cursor: not-allowed; }
#start-request { padding-inline: 1rem; flex-shrink: 0; }
#submit { width: 100%; margin-top: .2rem; }
#retry { width: 100%; white-space: normal; }

.status-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-inline: 1.25rem; gap: .375rem; }
.status-filter button {
  justify-content: space-between;
  text-align: left;
  font-size: .8125rem;
  min-height: 2.55rem;
  background: var(--mist);
  border-color: transparent;
  padding-inline: .6rem;
  font-variant-numeric: tabular-nums;
}
.status-filter strong { font-size: .875rem; font-variant-numeric: tabular-nums; }
.status-filter button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.queue-tools { display: flex; gap: .5rem; margin: .85rem 1.25rem; }
input:not([type=radio], [type=checkbox]), select, textarea {
  width: 100%;
  min-width: 0;
  min-height: 2.5rem;
  padding: .5rem .65rem;
  border: 1px solid var(--field-border);
  border-radius: var(--small-radius);
  background: var(--surface);
  color: var(--ink);
}
select { padding-right: 1.35rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; min-height: 6rem; }
.search { position: relative; flex: 1; min-width: 0; }
.search svg { position: absolute; top: .69rem; left: .62rem; width: 1.12rem; height: 1.12rem; color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.1rem !important; }
.channel { flex-shrink: 0; }
.gis-panel { margin: 0 1.25rem .85rem; }
.gis-panel summary {
  cursor: pointer;
  color: var(--deep);
  font-size: .9375rem;
  line-height: 2rem;
}
.gis-panel form { display: grid; gap: .7rem; padding-block: .45rem .7rem; }
.gis-panel button { justify-self: start; }
.gis-panel p { margin: 0; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }

.queue-table { min-width: 0; }
.queue-table thead { background: var(--deep); }
.queue-table th { color: var(--mast-text); }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: var(--mist); }
th, td { padding: .7rem .55rem; vertical-align: top; }
th { font-weight: 600; font-size: .8125rem; color: var(--muted); }
th:first-child, td:first-child { padding-left: 1.25rem; }
th:last-child, td:last-child { padding-right: 1.25rem; }
td { border-bottom: 1px solid var(--line); font-size: .875rem; }
td:first-child { width: 46%; }
td:last-child { min-width: 6.5rem; }
tbody tr:hover { background: var(--mist); }
.ticket-number, .ticket-title, .ticket-meta { display: block; min-width: 0; overflow-wrap: anywhere; }
.ticket-link { display: inline-block; color: var(--ink); text-decoration: none; }
.ticket-link:hover .ticket-title { text-decoration: underline; text-underline-offset: .16em; }
.ticket-number { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.ticket-title { font-weight: 650; text-decoration-thickness: 1px; }
.ticket-meta { margin-top: .2rem; color: var(--muted); font-size: .75rem; }
.badge {
  display: inline-block;
  padding: .2rem .5rem;
  border-radius: var(--small-radius);
  background: var(--mist);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
  white-space: nowrap;
}
.badge[data-status="new"] { background: var(--soft-blue); color: var(--soft-blue-text); }
.badge[data-status="assigned"], .badge[data-status="in_progress"], .badge[data-status="done"] { background: var(--soft-green); color: var(--soft-green-text); }
.badge[data-status="waiting"] { background: var(--soft-amber); color: var(--soft-amber-text); }
.badge[data-source="gis_zhkh"] { background: var(--soft-blue); color: var(--soft-blue-text); margin-block-start: .2rem; }
.ticket-actions { margin-top: .3rem; }
.ticket-actions summary { display: inline-block; cursor: pointer; color: var(--deep); font-size: .75rem; text-decoration: underline; text-underline-offset: .18em; }
.ticket-actions button { margin: .25rem .25rem .1rem 0; font-size: .75rem; min-height: 2rem; }
.ticket-empty { text-align: center; color: var(--muted); padding: 2.4rem 1rem; }
.queue-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem; padding: .6rem 1rem .65rem 1.25rem; }
.queue-footer p { margin: 0; color: var(--muted); font-size: .8125rem; }
.pagination { display: flex; align-items: center; gap: .2rem; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.pagination button { min-height: 2rem; padding-inline: .5rem; }

#request-form, #new-fields, #state-form { display: grid; gap: .8rem; min-width: 0; }
#request-form label, #state-form label { display: grid; gap: .3rem; font-weight: 600; font-size: .875rem; min-width: 0; }
#request-form label input, #request-form label select, #request-form label textarea, #state-form select, #state-form input { font-weight: 400; }
#request-form small { font-size: .75rem; color: var(--muted); font-weight: 400; }
.scope { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: 0; padding: 0; border: 0; }
.scope legend { padding: 0; margin-bottom: .3rem; font-size: .875rem; font-weight: 600; }
#request-form .scope label, #state-form .check { display: flex; align-items: center; gap: .35rem; font-weight: 400; }
.scope input, .check input { margin: 0; accent-color: var(--deep); }
.fields-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .5rem; }
.more-fields { border-block: 1px solid var(--line); padding-block: .5rem; }
.more-fields summary { cursor: pointer; color: var(--deep); font-weight: 600; font-size: .875rem; }
.more-fields label { margin-top: .65rem; }
input[type="file"] { font-size: .8125rem; }
::file-selector-button {
  border: 0;
  border-radius: var(--small-radius);
  padding: .35rem .5rem;
  margin-right: .45rem;
  background: var(--mist);
  color: var(--deep);
  cursor: pointer;
}
.result { padding: .65rem .75rem; background: var(--soft-green); color: var(--soft-green-text); border-radius: var(--small-radius); font-size: .875rem; }
.result.error { background: var(--soft-red); color: var(--soft-red-text); }
dialog {
  width: min(24rem, 100% - 2rem);
  padding: 1.15rem;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: var(--overlay); }
.dialog-actions { display: flex; justify-content: end; gap: .5rem; }
.login-page { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); max-width: 70rem; gap: 1rem; padding-block: 3rem; }
.login-panel { max-width: 29rem; margin-inline: auto; padding: 1.5rem; }
.login-page > .login-panel { width: 100%; max-width: none; margin: 0; display: flex; flex-direction: column; justify-content: center; padding: clamp(1.2rem, 4vw, 2.6rem); }
.login-art { display: grid; align-items: center; margin: 0; background: var(--deep); border-radius: var(--radius); overflow: clip; }
.login-art img { width: 100%; height: auto; display: block; }
.login-panel h1 { font-size: 1.8rem; }
.login-panel p { margin-block: .75rem 1.25rem; }
#login-form { display: grid; gap: .9rem; }
#login-form label { display: grid; gap: .3rem; font-weight: 600; }
#login-error { margin: 0; }
.ticket-dialog { width: min(47rem, 100% - 1.5rem); max-height: calc(100% - 2rem); }
.ticket-dialog-head { display: flex; justify-content: space-between; align-items: start; gap: .8rem; }
.ticket-dialog-head h2, .ticket-dialog h3 { overflow-wrap: anywhere; }
.ticket-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .75rem; margin-block: .7rem 1rem; }
.ticket-dialog h3 { margin: .9rem 0 .45rem; }
.ticket-dialog ul { padding-inline-start: 1.3rem; }
.ticket-article { border-top: 1px solid var(--line); padding-block: .75rem; }
.ticket-article p { white-space: pre-wrap; overflow-wrap: anywhere; margin: .35rem 0; }
.ticket-article .ticket-meta { margin: 0; }
.gis-location { display: grid; gap: .5rem; border-block-start: 1px solid var(--line); padding-block-start: .75rem; }
.gis-location p { margin: 0; color: var(--muted); font-size: .8125rem; overflow-wrap: anywhere; }
.gis-location input { display: block; max-width: 9rem; margin-block-start: .25rem; }
.gis-location-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ticket-history { margin-top: 1.25rem; }
.ticket-history li { margin-bottom: .4rem; overflow-wrap: anywhere; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .25rem 1rem; margin-block: 1rem 1.5rem; color: var(--muted); font-size: .8125rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: .75rem; left: .75rem; z-index: 2; padding: .65rem; background: var(--surface); }

@media (max-width: 63rem) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 47rem) {
  .login-page { grid-template-columns: minmax(0, 1fr); max-width: 31rem; padding-block: 1.3rem 2rem; }
  .login-art img { aspect-ratio: 860 / 380; object-fit: cover; object-position: 50% 53%; }
}
@media (max-width: 37rem) {
  .frame { width: calc(100% - 1.5rem); }
  .masthead-inner { min-height: 3.9rem; }
  .masthead nav { gap: .8rem; font-size: .8125rem; }
  .brand { gap: .45rem; }
  .brand-mark { width: 1.8rem; height: 1.8rem; }
  .brand-copy strong { font-size: 1rem; }
  .brand-copy span { font-size: .75rem; }
  .page-heading { display: grid; justify-items: start; margin-block: 1.35rem 1rem; gap: .7rem; }
  h1 { font-size: 2rem; }
  .queue-heading { padding: .75rem .8rem .5rem; }
  .status-filter { padding-inline: .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-filter button { min-height: 2.75rem; }
  .queue-tools { margin: .65rem .75rem; flex-wrap: wrap; }
  .search { flex-basis: 100%; }
  .channel { flex: 1; }
  .gis-panel { margin-inline: .75rem; }
  #gis-form input { font-size: 1rem; }
  .queue-footer { padding-inline: .75rem; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(5rem, 38%); gap: .25rem .6rem; padding: .75rem; border-block-start: 1px solid var(--line); }
  td, td:first-child, td:last-child { display: block; width: auto; min-width: 0; padding: 0; border: 0; font-size: .8125rem; }
  td:nth-child(2) { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45rem; }
  td:nth-child(3) { grid-column: 2; grid-row: 1; justify-self: end; }
  td:last-child { grid-column: 2; grid-row: 2; text-align: right; }
  td.ticket-empty { grid-column: 1 / -1; grid-row: 1; padding: 1rem .5rem; text-align: center; }
  .badge { font-size: .6875rem; }
  .badge { white-space: normal; }
  .intake { padding: .85rem; }
  #request-form input:not([type=radio]), #request-form select, #request-form textarea, #ticket-search, #channel-filter { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; }
}
