:root {
  color-scheme: light;
  --ink: #102b3f;
  --muted: #5b6f7c;
  --line: #d6e5e8;
  --surface: #ffffff;
  --background: #eef5f7;
  --accent: #007f8e;
  --accent-bright: #00abb8;
  --requester: #f0fafb;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
}
a { color: var(--accent); }
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.portal-brand img { display: block; width: min(240px, 48vw); height: auto; }
.portal-header nav { display: flex; gap: 18px; }
.portal-header nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.portal-main { width: min(980px, calc(100% - 32px)); margin: 48px auto 72px; }
.portal-intro { max-width: 760px; margin-bottom: 28px; }
.portal-intro h1 { margin: 6px 0 12px; font-size: clamp(2rem, 5vw, 3.2rem); }
.portal-intro p:last-child { color: var(--muted); font-size: 1.05rem; line-height: 1.65; }
.eyebrow { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.portal-card {
  margin-top: 20px;
  padding: clamp(22px, 4vw, 38px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 46px rgba(16, 43, 63, .08);
}
.portal-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.portal-card__head h2 { margin: 5px 0 6px; }
.portal-card__head p:last-child { margin: 0; color: var(--muted); }
.portal-alert { padding: 14px 18px; border-radius: 10px; background: #fff3cd; border: 1px solid #efd482; }
.portal-alert.is-success { color: #155b34; background: #e9f8ef; border-color: #aed8bd; }
.portal-status { display: inline-flex; padding: 7px 12px; border-radius: 999px; background: var(--requester); color: var(--accent); font-weight: 700; white-space: nowrap; }
.portal-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 28px 0; }
.portal-facts div { padding: 14px; background: #f7fafb; border-radius: 10px; }
.portal-facts dt { color: var(--muted); font-size: .78rem; }
.portal-facts dd { margin: 5px 0 0; font-weight: 600; }
.portal-thread { display: grid; gap: 14px; margin: 28px 0; }
.portal-message { max-width: 82%; padding: 16px 18px; border-radius: 15px; border: 1px solid var(--line); background: #f7fafb; }
.portal-message--requester { justify-self: end; background: var(--requester); border-color: #b9dfe3; }
.portal-message__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-bottom: 9px; color: var(--muted); font-size: .78rem; }
.portal-message p { margin: 0; white-space: pre-wrap; line-height: 1.55; }
.portal-reply { display: grid; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.portal-reply label { font-weight: 700; }
.portal-reply textarea { width: 100%; resize: vertical; padding: 14px; border: 1px solid #a9c7cc; border-radius: 10px; font: inherit; color: inherit; }
.portal-reply textarea:focus { outline: 3px solid rgba(0, 171, 184, .2); border-color: var(--accent); }
.portal-reply__actions { display: flex; justify-content: space-between; gap: 12px; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 17px; border: 1px solid var(--accent); border-radius: 9px; background: var(--accent); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.portal-button--secondary { background: #fff; color: var(--accent); }
.portal-button:disabled { opacity: .55; cursor: wait; }
.portal-ticket-list { display: grid; gap: 12px; margin-top: 24px; }
.portal-ticket { width: 100%; display: grid; grid-template-columns: 150px 1fr auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: inherit; text-align: left; cursor: pointer; }
.portal-ticket:hover { border-color: var(--accent-bright); box-shadow: 0 5px 18px rgba(16, 43, 63, .07); }
.portal-ticket strong, .portal-ticket span { display: block; }
.portal-ticket small { color: var(--muted); }
.portal-card--empty { text-align: center; }
.portal-card--empty .portal-button { margin-top: 12px; }
.portal-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; padding: 28px; color: var(--muted); font-size: .86rem; }
.portal-footer a { color: inherit; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
  .portal-header { align-items: flex-start; }
  .portal-header nav { flex-direction: column; gap: 8px; text-align: right; }
  .portal-card__head { flex-direction: column; }
  .portal-facts { grid-template-columns: 1fr; }
  .portal-message { max-width: 94%; }
  .portal-ticket { grid-template-columns: 1fr; gap: 8px; }
}
