:root {
  --ink: #20352f;
  --muted: #4c6158;
  --green: #2a594c;
  --strong: #21483e;
  --line: #dce4dd;
  --field-line: #aebeb2;
  --paper: #fff;
  --wash: #f3f6f2;
  --focus: #47816f;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  background: var(--wash);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  font: 15px/1.55 Arial, Helvetica, sans-serif;
  margin: 0;
  min-height: 100vh;
}
main { flex: 1 0 auto; }
a { color: var(--strong); text-underline-offset: 3px; }
a:hover { color: var(--green); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.wrap { margin-inline: auto; max-width: 1120px; padding-inline: 24px; width: 100%; }
.bar { background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-inner, .nav { align-items: center; display: flex; gap: 18px; }
.bar-inner { justify-content: space-between; min-height: 68px; padding-block: 10px; }
.brand { color: var(--ink); font-size: 23px; font-weight: 700; letter-spacing: -.8px; text-decoration: none; }
.brand span { color: var(--green); }
.nav form { margin: 0; }
.subtle-link { font-size: 14px; }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-top: 32px; padding-block: 18px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: clamp(25px, 4vw, 34px); letter-spacing: -.5px; line-height: 1.19; }
h2 { font-size: 20px; letter-spacing: -.2px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.35; }
h4 { font-size: 14px; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 13px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.gate { align-content: center; display: grid; min-height: 500px; padding-block: 44px 20px; }
.gate-panel { margin-inline: auto; max-width: 455px; padding: clamp(20px, 4.5vw, 34px); width: 100%; }
.gate-panel h1 { margin-bottom: 18px; }
.gate-panel > .muted { margin-bottom: 20px; }
.gate-links { display: grid; font-size: 14px; gap: 9px; margin-top: 20px; }
.notice { border: 1px solid var(--line); border-radius: 6px; margin-block: 0 18px; padding: 11px 13px; }
.notice.success { background: #edf5ed; border-color: #adc9b3; color: #225134; }
.notice.error { background: #fdf2ef; border-color: #d8aaa1; color: #873b32; }

.fields { display: grid; gap: 8px; }
.fields label { font-size: 14px; font-weight: 600; margin-top: 6px; }
.fields label:first-of-type { margin-top: 0; }
.fields input:not([type="hidden"]), .fields select, .fields textarea {
  background: var(--paper);
  border: 1px solid var(--field-line);
  border-radius: 5px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}
.fields textarea { resize: vertical; }
.fields > .button { margin-top: 9px; }
.button {
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 5px;
  color: var(--paper);
  cursor: pointer;
  display: inline-block;
  font: inherit;
  font-weight: 600;
  min-height: 43px;
  padding: 9px 16px;
  text-align: center;
  text-decoration: none;
}
.button:hover { background: var(--strong); color: var(--paper); }
.button.secondary { background: var(--paper); color: var(--strong); }
.button.secondary:hover { background: var(--wash); }
.button.compact { min-height: 38px; padding: 6px 11px; }

.dashboard { padding-top: 40px; }
.page-heading { align-items: end; display: flex; gap: 10px 22px; justify-content: space-between; margin-bottom: 24px; }
.identity, .account-email { color: var(--muted); overflow-wrap: anywhere; }
.identity { margin-top: 7px; }
.identity span { display: inline-block; margin-left: 4px; }
.account-email { font-size: 14px; }
.service-grid { align-items: start; display: grid; gap: 20px; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.service-grid h2 { margin-bottom: 16px; }
.asset-list { list-style: none; margin: 0; padding: 0; }
.asset-list li + li { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 15px; }
.metadata { display: grid; gap: 7px 12px; grid-template-columns: max-content minmax(0, 1fr); margin: 10px 0 0; }
.metadata dt, .ticket-meta dt { color: var(--muted); font-size: 13px; }
.metadata dd, .ticket-meta dd { margin: 0; overflow-wrap: anywhere; }
.document-link { display: inline-block; font-size: 14px; margin-top: 13px; }

.ticket-section { margin-top: 26px; }
.page-heading + .ticket-section { margin-top: 0; }
.ticket-section h2 { margin-bottom: 12px; }
.ticket-list { display: grid; gap: 13px; }
.ticket-heading { align-items: start; display: flex; gap: 12px; justify-content: space-between; }
.ticket-heading h3 { overflow-wrap: anywhere; }
.ticket-number { color: var(--muted); font-size: 13px; margin-bottom: 4px; overflow-wrap: anywhere; }
.status { background: #edf2ef; border-radius: 4px; color: #2d5043; flex-shrink: 0; font-size: 13px; font-weight: 600; padding: 3px 8px; }
.status.in_progress { background: #fff2da; color: #734c12; }
.status.resolved { background: #e8f5e9; color: #2c5736; }
.critical { color: #873b32; font-weight: 600; }
.ticket-meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 12px 0 0; }
.ticket-text { margin-top: 12px; overflow-wrap: anywhere; white-space: pre-wrap; }
.comment, .staff-update { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.comment .ticket-text { margin-top: 2px; }
.staff-update { max-width: 620px; }
.staff-update > .button { justify-self: start; }

@media (max-width: 740px) {
  .service-grid { grid-template-columns: 1fr; }
  .page-heading { align-items: start; flex-direction: column; }
  .dashboard { padding-top: 27px; }
}
@media (max-width: 430px) {
  .wrap { padding-inline: 16px; }
  .nav, .bar-inner { gap: 10px; }
  .panel { padding: 18px; }
  .gate { align-content: start; min-height: 0; }
  .metadata { gap: 3px; grid-template-columns: 1fr; }
  .metadata dd + dt { margin-top: 5px; }
  .ticket-heading { flex-wrap: wrap; }
}
