:root {
  color-scheme: light;
  --bg: #eaf5fb;
  --surface: #ffffff;
  --surface-soft: #f7fbfe;
  --surface-tint: #eef8fd;
  --line: rgba(29, 78, 113, 0.14);
  --line-strong: rgba(15, 95, 140, 0.24);
  --text: #183044;
  --text-soft: #5c7486;
  --blue: #0f5f8c;
  --blue-strong: #1f7cab;
  --blue-soft: #dff1fa;
  --green: #2f7d64;
  --green-strong: #1f5b46;
  --green-soft: #c9ebd7;
  --green-line: rgba(47, 125, 100, 0.42);
  --amber: #a56a1d;
  --amber-soft: #ffe3a1;
  --amber-line: rgba(165, 106, 29, 0.5);
  --red: #a44141;
  --red-soft: #f6c8c8;
  --red-line: rgba(164, 65, 65, 0.48);
  --shadow: 0 24px 58px rgba(26, 73, 105, 0.13);
  --shadow-soft: 0 10px 28px rgba(26, 73, 105, 0.08);
  --page-gutter: clamp(16px, 3vw, 32px);
  --sidebar-width: 300px;
  --public-width: min(800px, calc(100% - (var(--page-gutter) * 2)));
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #e8f6fc 0%, #f5fbff 46%, #edf8fd 100%);
}

body.has-cookie-banner {
  padding-bottom: 112px;
}

body.has-install-prompt {
  padding-bottom: 118px;
}

body.has-cookie-banner.has-install-prompt {
  padding-bottom: 228px;
}

a {
  color: inherit;
}

button,
input,
select,
textarea,
code {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100svh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 28px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(237, 250, 232, 0.96), rgba(222, 243, 229, 0.94)),
    #edf8e9;
  box-shadow: 12px 0 36px rgba(47, 125, 100, 0.08);
}

.brand h1 {
  margin: 6px 0 10px;
  font-size: 2rem;
  line-height: 1.05;
}

.brand p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.brand-logo {
  display: block;
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo-link {
  display: inline-flex;
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-logo-link:hover .brand-logo {
  transform: translateY(-1px);
}

.brand-logo-sidebar {
  width: 72px;
  height: 72px;
  margin-bottom: 12px;
  transition: transform 140ms ease;
}

.brand-kicker,
.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--text-soft);
}

.nav {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-group-title {
  margin: 0 0 2px;
  padding: 0 8px;
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-group-items {
  display: grid;
  gap: 8px;
}

.nav-link {
  display: block;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.nav-link:hover,
.nav-link-active {
  background: linear-gradient(135deg, rgba(223, 241, 250, 0.95), rgba(255, 255, 255, 0.9));
  border-color: var(--line-strong);
  box-shadow: 0 10px 24px rgba(15, 95, 140, 0.08);
  transform: translateX(2px);
}

.panel,
.hero {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace {
  min-width: 0;
  padding: var(--page-gutter);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 4px 0 0;
  font-size: 2rem;
  line-height: 1.1;
}

.status-cluster,
.button-row,
.filter-row,
.checkbox-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
}

.status-chip-session {
  gap: 12px;
  max-width: 100%;
  padding-right: 8px;
}

.status-session-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.status-session-label {
  font-weight: 800;
  color: var(--text);
}

.status-session-user {
  max-width: 180px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.86rem;
  text-overflow: ellipsis;
}

.status-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-left: auto;
  min-height: 38px;
  padding: 0 13px;
  border-left: 1px solid var(--line);
  color: var(--blue-dark);
  font-weight: 800;
  text-decoration: none;
}

.status-logout:hover {
  color: var(--blue);
}

.status-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.status-dot-live {
  background: var(--green);
}

.page,
.stack {
  display: grid;
  gap: 20px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  background:
    linear-gradient(120deg, rgba(223, 241, 250, 0.92), rgba(255, 255, 255, 0.96)),
    var(--surface);
}

.hero-compact {
  align-items: center;
}

.hero h1,
.hero h3 {
  margin: 6px 0 10px;
  max-width: 18ch;
  font-size: 2rem;
  line-height: 1.1;
}

.hero-copy {
  max-width: 66ch;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.hero-note {
  min-width: 220px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.hero-note strong {
  display: block;
  margin-top: 10px;
  font-size: 1.2rem;
}

.hero-note p {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.panel {
  padding: 22px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-header-spaced {
  margin-top: 16px;
}

.panel-header h1,
.panel-header h2,
.panel-header h3 {
  margin: 4px 0 0;
  line-height: 1.15;
}

.panel-header h1 {
  font-size: 2rem;
}

.panel-header h2,
.panel-header h3 {
  font-size: 1.45rem;
}

.metric-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metric-card {
  display: block;
  color: inherit;
  text-decoration: none;
  text-align: center;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--green-line);
  background: linear-gradient(135deg, rgba(227, 245, 235, 0.96), rgba(249, 255, 252, 0.98));
  box-shadow: var(--shadow-soft);
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.metric-card:hover,
.metric-card:focus-visible {
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px rgba(26, 73, 105, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.metric-card-red {
  border-color: var(--red-line);
  background: linear-gradient(135deg, #f6c8c8, #fff2f2);
}

.metric-card-blue {
  border-color: rgba(15, 95, 140, 0.24);
  background: linear-gradient(135deg, #dff1fa, #f6fcff);
}

.metric-card-green {
  border-color: var(--green-line);
  background: linear-gradient(135deg, #c9ebd7, #eaf8ef);
}

.metric-card-amber {
  border-color: var(--amber-line);
  background: linear-gradient(135deg, #ffe3a1, #fff2ce);
}

.metric-card-darkgreen {
  border-color: rgba(31, 91, 70, 0.56);
  background: linear-gradient(135deg, #8fc7a5, #d9f1e2);
}

.metric-label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-soft);
}

.metric-value {
  display: block;
  font-size: 2.2rem;
  line-height: 1;
}

.metric-value-compact {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.metric-copy {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.detail-section-grid,
.detail-form-grid {
  display: grid;
  gap: 16px;
}

.detail-section-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.detail-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.support-create-form {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  align-items: end;
}

.support-create-form .panel-header,
.support-create-form .button-row {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
}

.field-inline {
  width: min(220px, 100%);
}

.field-search {
  flex: 1 1 260px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-self: end;
  flex-wrap: wrap;
}

.quick-filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.quick-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-soft);
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.quick-filter:hover,
.quick-filter-active {
  border-color: rgba(15, 95, 140, 0.22);
  background: linear-gradient(135deg, #0f5f8c, #1f7cab);
  color: #fff;
}

.field-label {
  font-weight: 700;
}

.required-marker {
  color: var(--red);
}

.optional-marker {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.required-hint {
  margin: 0;
}

.field-hint {
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.45;
}

.retention-setting {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(260px, 1fr);
  gap: 18px;
  align-items: end;
  max-width: 860px;
}

.retention-field {
  gap: 10px;
}

.input-with-unit {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.input-with-unit input {
  min-width: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-unit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 18px 18px 0;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.retention-copy {
  margin: 0 0 10px;
  max-width: 520px;
}

.form-notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--text-soft);
  line-height: 1.55;
}

.form-notice a {
  color: var(--blue);
  font-weight: 700;
}

.captcha-check {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.captcha-check input {
  width: 20px;
  height: 20px;
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

input[type="checkbox"],
input[type="radio"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line-strong);
  background: #fff;
  accent-color: var(--blue);
  box-shadow: none;
}

input[type="checkbox"] {
  border-radius: 5px;
}

input[type="radio"] {
  border-radius: 50%;
}

.row-selector {
  width: auto;
}

.checkbox-field {
  align-content: start;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(15, 95, 140, 0.14);
  border-color: var(--line-strong);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
  outline: 3px solid rgba(15, 95, 140, 0.14);
  outline-offset: 2px;
}

textarea {
  min-height: 150px;
  resize: vertical;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 12px 16px;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(26, 73, 105, 0.06);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.button:hover:not(:disabled) {
  border-color: var(--line-strong);
  box-shadow: 0 12px 24px rgba(26, 73, 105, 0.1);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-primary {
  border-color: rgba(15, 95, 140, 0.18);
  background: linear-gradient(135deg, #0f5f8c, #1f7cab);
  color: #fff;
}

.button-danger {
  border-color: rgba(164, 65, 65, 0.18);
  background: rgba(164, 65, 65, 0.1);
  color: var(--red);
}

.button-full {
  width: 100%;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.pill-warning {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  color: var(--amber);
}

.pill-pending,
.pill-ready,
.pill-info {
  background: var(--green-soft);
  border: 1px solid var(--green-line);
  color: var(--green);
}

.pill-success {
  background: var(--green-strong);
  border: 1px solid rgba(31, 91, 70, 0.7);
  color: #fff;
}

.pill-error {
  background: var(--red-soft);
  border: 1px solid var(--red-line);
  color: var(--red);
}

.pill-neutral {
  background: rgba(15, 95, 140, 0.08);
  color: var(--text);
}

.overview-table {
  display: grid;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.bulk-ticket-form {
  display: grid;
  gap: 16px;
}

.bulk-actions-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
}

.bulk-delete-confirm {
  min-height: 46px;
}

.bulk-dependent[hidden] {
  display: none;
}

.overview-head,
.overview-row {
  display: grid;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.overview-head-tickets,
.overview-row-tickets {
  grid-template-columns: 36px minmax(180px, 1.45fr) minmax(135px, 0.95fr) minmax(105px, 0.7fr) minmax(110px, 0.72fr) minmax(105px, 0.65fr) minmax(95px, 0.62fr) minmax(125px, 0.78fr) minmax(125px, 0.78fr);
  min-width: 1040px;
  gap: 10px;
}

.overview-head-supporters,
.overview-row-supporters {
  grid-template-columns: minmax(240px, 1.5fr) minmax(100px, 0.55fr) minmax(130px, 0.7fr) minmax(170px, 0.9fr) auto;
}

.overview-head-categories,
.overview-row-categories {
  grid-template-columns: minmax(260px, 1.5fr) minmax(90px, 0.4fr) minmax(120px, 0.55fr) minmax(260px, 1fr);
}

.category-row-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.category-actions {
  justify-content: flex-start;
}

.overview-head {
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(223, 241, 250, 0.72);
  border: 1px solid rgba(15, 95, 140, 0.09);
  color: var(--text-soft);
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.overview-select,
.ticket-select-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.ticket-select-cell {
  cursor: pointer;
}

.ticket-row-link {
  width: fit-content;
  max-width: 100%;
  color: var(--text);
  text-decoration: none;
}

.ticket-row-link:hover {
  color: var(--blue);
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-transform: inherit;
}

.sort-button::after {
  content: "\2195";
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1;
}

.sort-button[data-sort-direction="asc"]::after {
  content: "\2191";
}

.sort-button[data-sort-direction="desc"]::after {
  content: "\2193";
}

.sort-button:hover,
.sort-button:focus-visible,
.sort-button-active {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  outline: none;
}

.sort-button:hover:not(:disabled) {
  box-shadow: none;
  transform: none;
}

.overview-row {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.overview-row:hover {
  border-color: var(--line-strong);
  box-shadow: 0 14px 30px rgba(26, 73, 105, 0.11);
  transform: translateY(-1px);
}

.overview-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.overview-row strong,
.overview-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-row strong {
  white-space: nowrap;
}

.overview-row span {
  color: var(--text-soft);
  line-height: 1.4;
}

.ticket-table .pill {
  white-space: nowrap;
}

.ticket-table .overview-head-tickets,
.ticket-table .overview-row-tickets {
  grid-template-columns: 36px minmax(260px, 1.4fr) minmax(220px, 1.08fr) minmax(160px, 0.78fr) minmax(150px, 0.72fr) minmax(140px, 0.62fr) minmax(140px, 0.62fr) minmax(170px, 0.82fr) minmax(150px, 0.72fr);
  min-width: 1420px;
}

.ticket-table .overview-head-tickets .sort-button,
.ticket-table .overview-row-tickets strong,
.ticket-table .overview-row-tickets span {
  white-space: nowrap;
}

.ticket-table .ticket-row-link {
  width: 100%;
}

.support-table .button {
  width: fit-content;
  white-space: nowrap;
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.compact-list-row div {
  display: grid;
  gap: 4px;
}

.compact-list-row-main {
  flex: 1;
  min-width: 0;
}

.compact-list-row span {
  color: var(--text-soft);
}

.breakable {
  overflow-wrap: anywhere;
}

.delete-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.delete-confirm {
  align-items: center;
  color: var(--text-soft);
}

.timeline {
  display: grid;
  gap: 12px;
}

.message-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.message-item-internal {
  border-color: var(--amber-line);
  background: linear-gradient(135deg, #fff8e5, #fff);
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--text-soft);
  margin-bottom: 10px;
}

.message-meta strong {
  color: var(--text);
}

.message-item p,
.message-body {
  margin: 0;
  line-height: 1.6;
  white-space: normal;
}

.message-body {
  max-height: min(54vh, 560px);
  overflow: auto;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.attachment-thumb {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.attachment-thumb:hover {
  border-color: var(--line-strong);
}

.attachment-thumb img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  object-fit: cover;
  background: #fff;
}

.attachment-thumb span {
  min-width: 0;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state h3,
.empty-state h1 {
  margin: 0 0 10px;
}

.empty-state p {
  color: var(--text-soft);
  line-height: 1.6;
}

.action-notice {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--green-line);
  background: linear-gradient(135deg, rgba(227, 245, 235, 0.96), rgba(249, 255, 252, 0.98));
  box-shadow: var(--shadow-soft);
}

.action-notice strong {
  display: block;
  margin-bottom: 4px;
}

.action-notice p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.45;
}

.action-notice-error {
  border-color: var(--red-line);
  background: linear-gradient(135deg, #f6c8c8, #fde6e6);
}

.action-notice-pending {
  border-color: var(--amber-line);
  background: linear-gradient(135deg, #ffe3a1, #fff2ce);
}

.public-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.public-topbar {
  width: var(--public-width);
  margin: 0 auto 0 var(--page-gutter);
  padding: 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-inline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--green));
  box-shadow: var(--shadow-soft);
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.public-nav-link {
  padding: 10px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--text-soft);
  font-weight: 700;
}

.public-nav-active,
.public-nav-link:hover {
  color: #fff;
  background: linear-gradient(135deg, #0f5f8c, #1f7cab);
}

.public-main {
  width: var(--public-width);
  margin: 0 auto 0 var(--page-gutter);
  padding: 20px 0 56px;
  display: grid;
  gap: 20px;
  align-content: start;
}

.public-panel,
.login-panel {
  width: 100%;
}

.login-panel {
  justify-self: stretch;
}

.public-hero,
.hero-setup {
  width: 100%;
}

.legal-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.legal-footer a {
  color: var(--text-soft);
  font-weight: 700;
  text-decoration: none;
}

.legal-footer a:hover {
  color: var(--blue);
}

.legal-panel {
  width: 100%;
  justify-self: stretch;
}

.legal-content {
  color: var(--text);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4 {
  margin: 1.2em 0 0.45em;
  line-height: 1.2;
}

.legal-content h1:first-child,
.legal-content h2:first-child,
.legal-content h3:first-child,
.legal-content h4:first-child,
.legal-content p:first-child {
  margin-top: 0;
}

.legal-content p,
.legal-content ul,
.legal-content ol {
  margin: 0 0 1em;
}

.legal-content ul,
.legal-content ol {
  padding-left: 1.4rem;
}

.legal-content li + li {
  margin-top: 0.35em;
}

.legal-content a {
  color: var(--blue);
  font-weight: 700;
}

.legal-content code {
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
}

.legal-textarea {
  min-height: 260px;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-soft);
}

.settings-tab {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 800;
}

.settings-tab:hover,
.settings-tab-active {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.settings-tab-panel {
  display: grid;
  gap: 18px;
}

.settings-tab-panel[hidden] {
  display: none;
}

.version-panel {
  width: min(760px, 100%);
}

.version-change-list {
  margin: 4px 0 0;
  padding-left: 1.25rem;
  color: var(--text-soft);
  line-height: 1.55;
}

.version-change-list li + li {
  margin-top: 4px;
}

.version-history {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.version-history-item {
  display: grid;
  gap: 4px;
}

.version-history-item strong {
  color: var(--text);
}

.version-badge {
  display: grid;
  gap: 6px;
  min-width: 240px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.version-badge span {
  color: var(--text-soft);
  font-weight: 700;
}

.version-badge strong {
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.1;
}

.cookie-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.install-prompt {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 18px;
  z-index: 48;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.install-prompt[hidden] {
  display: none;
}

.install-prompt img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
}

.install-prompt-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.install-prompt-copy strong,
.install-prompt-copy span {
  overflow-wrap: anywhere;
}

.install-prompt-copy span {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.install-prompt-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
}

.install-prompt-actions .button {
  flex: 1;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 14px;
}

.install-dismiss {
  box-shadow: none;
}

body.has-cookie-banner .install-prompt {
  bottom: 128px;
}

html.is-embedded {
  --page-gutter: 18px;
  --sidebar-width: 260px;
}

.is-embedded .sidebar {
  padding: 18px;
}

.is-embedded .workspace {
  padding: 18px 20px;
}

.is-embedded .hero,
.is-embedded .panel {
  border-radius: 18px;
}

.is-embedded .public-topbar,
.is-embedded .public-main {
  margin-left: var(--page-gutter);
  margin-right: auto;
}

@media (max-width: 1180px) {
  :root {
    --sidebar-width: 260px;
    --page-gutter: 22px;
  }

  .sidebar {
    padding: 22px;
  }

  .brand h1 {
    font-size: 1.75rem;
  }

  .nav-link {
    padding: 12px 14px;
  }
}

@media (max-width: 980px) {
  :root {
    --page-gutter: 20px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }

  .topbar,
  .hero,
  .panel-header,
  .compact-list-row {
    flex-direction: column;
    align-items: stretch;
  }

  .overview-head,
  .overview-row,
  .overview-head-supporters,
  .overview-row-supporters,
  .overview-head-categories,
  .overview-row-categories,
  .category-row-form {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .field-inline {
    width: 100%;
  }

  .ticket-table {
    font-size: 0.78rem;
  }

  .ticket-table .overview-head-tickets,
  .ticket-table .overview-row-tickets {
    grid-template-columns: 34px minmax(240px, 1.4fr) minmax(200px, 1.08fr) minmax(145px, 0.78fr) minmax(135px, 0.72fr) minmax(130px, 0.62fr) minmax(130px, 0.62fr) minmax(155px, 0.82fr) minmax(140px, 0.72fr);
    min-width: 1320px;
    gap: 8px;
  }
}

@media (max-width: 760px) {
  .overview-head {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
  }

  .overview-head .sort-button {
    width: auto;
    min-height: 36px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
  }

  .overview-head-tickets {
    display: grid;
    align-items: center;
    flex-wrap: initial;
  }

  .ticket-table .overview-head-tickets .sort-button {
    width: 100%;
    border: 0;
    background: transparent;
  }

  .overview-select {
    width: 40px;
  }

  .overview-row {
    gap: 10px;
  }

  .bulk-actions-grid,
  .filter-row,
  .status-cluster {
    align-items: stretch;
    flex-direction: column;
  }

  .field-search,
  .filter-actions {
    width: 100%;
  }

  .retention-setting {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .retention-copy {
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --page-gutter: 14px;
  }

  .workspace,
  .sidebar {
    padding: var(--page-gutter);
  }

  .public-topbar {
    width: var(--public-width);
    align-items: stretch;
    flex-direction: column;
  }

  .public-nav {
    width: 100%;
    justify-content: stretch;
  }

  .public-nav-link {
    flex: 1;
    text-align: center;
  }

  .public-main {
    width: var(--public-width);
    padding-bottom: 36px;
  }

  .status-chip-session {
    width: 100%;
  }

  .status-session-user {
    max-width: clamp(92px, 36vw, 150px);
  }

  .hero h1,
  .hero h3,
  .topbar h2,
  .brand h1 {
    font-size: 1.65rem;
  }

  .panel,
  .hero {
    padding: 18px;
    border-radius: 18px;
  }

  .button-row,
  .filter-actions,
  .settings-tabs {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .captcha-check {
    width: 100%;
  }

  .settings-tab {
    width: 100%;
  }

  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .install-prompt {
    left: var(--page-gutter);
    right: var(--page-gutter);
    width: calc(100% - (var(--page-gutter) * 2));
  }

  body.has-cookie-banner .install-prompt {
    bottom: 222px;
  }

  body.has-cookie-banner {
    padding-bottom: 210px;
  }

  body.has-install-prompt {
    padding-bottom: 126px;
  }

  body.has-cookie-banner.has-install-prompt {
    padding-bottom: 328px;
  }
}

@media (min-width: 761px) {
  .install-prompt {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.ticket-table {
  max-width: 100%;
  overflow-x: auto;
}

.ticket-table .overview-head-tickets,
.ticket-table .overview-row-tickets {
  display: grid !important;
  grid-template-columns: 38px 310px 250px 170px 160px 150px 150px 190px 170px !important;
  grid-auto-flow: column;
  grid-template-rows: auto !important;
  width: max(100%, 1588px);
  min-width: 1588px !important;
  flex-wrap: nowrap !important;
}

.ticket-table .overview-head-tickets > *,
.ticket-table .overview-row-tickets > * {
  grid-row: 1 !important;
  min-width: 0;
}

.ticket-table .overview-head-tickets .sort-button,
.ticket-table .overview-row-tickets strong,
.ticket-table .overview-row-tickets span,
.ticket-table .overview-row-tickets a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap !important;
}

.app-shell {
  grid-template-columns: minmax(0, 1fr);
}

.workspace {
  width: 100%;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 70;
  width: min(320px, calc(100vw - 28px));
  height: 100vh;
  height: 100dvh;
  padding: 28px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  border-bottom: 0;
  transform: translateX(calc(-100% - 24px));
  transition: transform 180ms ease;
}

.sidebar .nav {
  grid-template-columns: 1fr;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .sidebar {
  transform: translateX(0);
}

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: rgba(24, 48, 68, 0.34);
  backdrop-filter: blur(2px);
  box-shadow: none;
  cursor: pointer;
}

.menu-overlay[hidden] {
  display: none;
}

.menu-overlay:hover:not(:disabled) {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sidebar-close,
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.sidebar-close {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.7rem;
  line-height: 1;
}

.menu-toggle {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 14px;
  flex-direction: column;
  gap: 4px;
}

.menu-toggle span {
  width: 21px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
}

.sidebar-close:hover,
.menu-toggle:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

body.menu-open .menu-toggle {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.topbar-logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
  text-decoration: none;
}

.topbar-logo {
  width: 52px;
  height: 52px;
  transition: transform 140ms ease;
}

.topbar-logo-link:hover .topbar-logo {
  transform: translateY(-1px);
}

.topbar-title {
  min-width: 0;
}

.topbar-title h2 {
  overflow-wrap: anywhere;
}

@media (max-width: 980px) {
  .topbar-main {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .sidebar {
    width: min(300px, calc(100vw - 18px));
    padding: 18px;
  }

  .menu-toggle {
    width: 44px;
    height: 44px;
  }

  .topbar-main {
    gap: 10px;
  }

  .topbar-logo {
    width: 44px;
    height: 44px;
  }
}
