:root {
  --color-bg: #f4f7f4;
  --color-panel: #fff;
  --color-text: #17211f;
  --color-primary: #176b5b;
  --color-primary-hover: #0f5144;
  --color-secondary: #51645e;
  --color-secondary-hover: #3d4d48;
  --color-muted: #5f6e69;
  --color-border: #dfe8e4;
  --color-input-border: #c8d5d0;
  --color-accent: #c65b2e;
  --color-danger: #b00020;
  --color-danger-hover: #8c0019;
  --color-success: #087a3d;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  overscroll-behavior-y: contain;
}

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

button,
.admin-link {
  border: 0;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  padding: 0.8rem 1rem;
  text-decoration: none;
  white-space: nowrap;
}

button:hover,
.admin-link:hover {
  background: var(--color-primary-hover);
}

button.secondary {
  background: var(--color-secondary);
}

button.secondary:hover {
  background: var(--color-secondary-hover);
}

button.danger {
  background: var(--color-danger);
  margin-top: 12px;
}

button.compact {
  font-size: 0.88rem;
  padding: 0.55rem 0.75rem;
}

button.danger:hover {
  background: var(--color-danger-hover);
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.admin-shell {
  width: min(1180px, calc(100% - 32px));
}

.panel {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 22px;
}

.intro,
.toolbar,
.inline {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.toolbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.icon-button {
  align-items: center;
  display: inline-flex;
  font-size: 1.3rem;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.page-menu {
  margin-left: auto;
  order: 3;
  position: relative;
}

.page-menu-list {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 33, 31, 0.16);
  display: grid;
  gap: 4px;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
}

.page-menu-list.hidden {
  display: none;
}

.page-menu-list a {
  background: transparent;
  color: var(--color-text);
  padding: 0.65rem 0.75rem;
  text-align: left;
  text-decoration: none;
}

.page-menu-list a:hover {
  background: #eef4f1;
}

.admin-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.brand-head {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 16px;
}

.brand-topline {
  display: contents;
}

.brand-copy {
  min-width: 0;
  order: 2;
}

.brand-logo {
  border-radius: 8px;
  flex: 0 0 auto;
  height: 68px;
  object-fit: contain;
  width: 68px;
}

.intro h1,
.toolbar h2 {
  margin: 0;
}

.intro p {
  margin-bottom: 0;
}

.submission-group-title {
  color: var(--color-primary);
  display: block;
  font-size: clamp(1.35rem, 2.8vw, 2.25rem);
  line-height: 1.1;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.session-info {
  color: var(--color-secondary);
  font-size: 0.95rem;
  margin: 8px 0 0;
}

.eyebrow {
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.form {
  display: grid;
  gap: 10px;
}

.ios-install-note {
  background: #fff8ec;
  border: 1px solid #efd4a7;
  border-left: 5px solid var(--color-accent);
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 14px 16px;
}

.ios-install-note p {
  margin: 4px 0 0;
}

label {
  font-weight: 700;
}

.form-help {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: -6px 0 2px;
}

input,
select,
textarea {
  border: 1px solid var(--color-input-border);
  border-radius: 8px;
  min-width: 0;
  padding: 0.78rem;
  width: 100%;
}

textarea {
  resize: vertical;
}

.markdown-toolbar,
.asset-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.markdown-toolbar button {
  align-items: center;
  background: var(--color-secondary);
  border-radius: 8px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 36px;
  justify-content: center;
  min-width: 36px;
  padding: 0 0.65rem;
  width: auto;
}

.markdown-toolbar button:hover {
  background: var(--color-secondary-hover);
}

.inline input {
  flex: 1;
}

.check {
  align-items: center;
  display: flex;
  gap: 10px;
}

.check input {
  width: auto;
}

.status {
  color: var(--color-primary);
  min-height: 1.4em;
}

.status.error {
  color: var(--color-danger);
}

.copy-popup {
  background: var(--color-text);
  border-radius: 8px;
  bottom: 24px;
  box-shadow: 0 10px 28px rgba(23, 33, 31, 0.22);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  left: 50%;
  opacity: 0;
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  transform: translate(-50%, 10px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100;
}

.copy-popup.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-footer {
  align-items: center;
  color: var(--color-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.86rem;
  gap: 10px;
  justify-content: center;
  padding: 4px 0 18px;
  text-align: center;
}

.site-footer a {
  color: var(--color-primary);
  font-weight: 700;
}

.site-footer a:hover {
  color: var(--color-primary-hover);
}

.site-footer .app-version {
  color: var(--color-muted);
  font-weight: 400;
  text-decoration: none;
}

.site-footer .app-version:hover {
  color: var(--color-muted);
}

.hidden {
  display: none;
}

.pull-refresh {
  background: var(--color-primary);
  border-radius: 0 0 8px 8px;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  left: 50%;
  opacity: 0;
  padding: 10px 16px;
  pointer-events: none;
  position: fixed;
  top: 0;
  transform: translate(-50%, -48px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.pull-refresh.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.push-prompt {
  align-items: center;
  background: #eef8f5;
  border: 1px solid #badbd2;
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 14px 16px;
}

.push-prompt p {
  margin: 4px 0 0;
}

.push-prompt.active {
  background: #f0fff7;
  border-color: #b9e1c9;
  border-left-color: var(--color-success);
}

.push-prompt.active strong {
  color: var(--color-success);
}

.push-prompt.blocked {
  background: #fff8ec;
  border-color: #efd4a7;
  border-left-color: var(--color-accent);
}

.push-prompt.blocked strong {
  color: #9a451f;
}

.push-prompt.unsupported {
  background: #fff9db;
  border-color: #ead47a;
  border-left-color: #c39a08;
}

.push-prompt.unsupported strong {
  color: #7a5d00;
}

.news-list {
  display: grid;
  gap: 12px;
}

.news-item {
  border: 1px solid var(--color-border);
  border-left: 5px solid #7d8b87;
  border-radius: 8px;
  padding: 16px;
}

.news-item.wichtig {
  border-left-color: var(--color-accent);
}

.news-item.wetter {
  border-left-color: #1f78b4;
}

.news-item.alarm {
  animation: alarm-pulse 1.6s ease-in-out infinite;
  background: #fff4f4;
  border-color: var(--color-danger);
  border-left-color: var(--color-danger);
  border-left-width: 8px;
  box-shadow: 0 0 0 2px rgba(176, 0, 32, 0.18);
}

.news-item.alarm .news-meta span {
  background: var(--color-danger);
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  padding: 4px 8px;
}

.news-item.alarm h3 {
  color: var(--color-danger);
  font-size: 1.35rem;
  text-transform: uppercase;
}

.news-item.entwarnung {
  animation: entwarnung-pulse 1.8s ease-in-out infinite;
  background: #f0fff7;
  border-color: var(--color-success);
  border-left-color: var(--color-success);
  border-left-width: 8px;
  box-shadow: 0 0 0 2px rgba(8, 122, 61, 0.18);
}

.news-item.entwarnung .news-meta span {
  background: var(--color-success);
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  padding: 4px 8px;
}

.news-item.entwarnung h3 {
  color: var(--color-success);
  font-size: 1.28rem;
}

.news-item {
  background: var(--category-bg, var(--color-panel));
  border-left-color: var(--category-color, #7d8b87);
}

.news-item.highlight-standard,
.news-item.highlight-badge {
  animation: none;
  background: var(--category-bg, var(--color-panel));
  border-color: var(--color-border);
  border-left-color: var(--category-color, #7d8b87);
  border-left-width: 5px;
  box-shadow: none;
}

.news-item.highlight-standard h3,
.news-item.highlight-badge h3 {
  color: var(--color-text);
  text-transform: none;
}

.news-item.highlight-standard .news-meta span,
.news-item.highlight-badge .news-meta span {
  background: transparent;
  border-radius: 0;
  color: var(--color-muted);
  font-weight: inherit;
  padding: 0;
}

.news-item.highlight-badge .news-meta span:first-child,
.news-item.highlight-pulse .news-meta span:first-child {
  background: var(--category-color, var(--color-primary));
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  padding: 4px 8px;
}

.news-item.highlight-pulse {
  animation: category-pulse 1.7s ease-in-out infinite;
  background: var(--category-bg, #fff4f4);
  border-color: var(--category-color, var(--color-danger));
  border-left-color: var(--category-color, var(--color-danger));
  border-left-width: 8px;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--category-color, var(--color-danger)) 18%, transparent);
}

.news-item.highlight-pulse h3 {
  color: var(--category-color, var(--color-danger));
  text-transform: none;
}

@keyframes category-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--category-color, var(--color-danger)) 18%, transparent);
  }

  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--category-color, var(--color-danger)) 32%, transparent);
  }
}

@keyframes alarm-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(176, 0, 32, 0.18);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(176, 0, 32, 0.32);
  }
}

@keyframes entwarnung-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(8, 122, 61, 0.18);
  }

  50% {
    box-shadow: 0 0 0 5px rgba(8, 122, 61, 0.28);
  }
}

@media (prefers-reduced-motion: reduce) {
  .news-item.alarm,
  .news-item.entwarnung,
  .news-item.highlight-pulse {
    animation: none;
  }
}

.news-meta {
  color: var(--color-muted);
  display: flex;
  font-size: 0.88rem;
  gap: 12px;
  justify-content: space-between;
  text-transform: uppercase;
}

.news-item h3 {
  margin: 10px 0 8px;
}

.news-title-row {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.news-title-row h3 {
  flex: 1;
  min-width: 0;
}

.share-button {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 1rem;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.share-button svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.admin-news-item {
  padding: 12px 14px;
}

.admin-news-item h3 {
  font-size: 1.05rem;
  margin: 6px 0;
}

.admin-news-meta {
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.8rem;
  justify-content: flex-start;
}

.admin-news-body {
  color: var(--color-text);
  line-height: 1.45;
}

.linked-page-note {
  color: var(--color-primary);
  font-weight: 700;
  margin: 8px 0 0;
}

.linked-page-link {
  align-self: start;
  background: #eef4f1;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  color: var(--color-primary);
  display: inline-block;
  font-weight: 800;
  margin-top: 10px;
  padding: 0.8rem 1rem;
  text-decoration: none;
}

.linked-page-link:hover {
  background: #dfe8e4;
}

.admin-news-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-news-actions button.danger {
  margin-top: 0;
}

.pagination {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 14px;
}

.pagination button[aria-current="page"] {
  cursor: default;
}

.admin-page-details summary {
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.admin-page-details summary span {
  font-size: 1.05rem;
  font-weight: 800;
}

.admin-page-details summary small {
  color: var(--color-muted);
  font-size: 0.84rem;
}

.admin-page-details[open] summary {
  margin-bottom: 12px;
}

.page-public-link {
  color: var(--color-muted);
  font-size: 0.88rem;
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}

.page-public-link a {
  color: var(--color-primary);
  font-weight: 800;
}

.reply-compose summary {
  background: var(--color-secondary);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  list-style: none;
  padding: 0.55rem 0.75rem;
}

.reply-compose summary:hover {
  background: var(--color-secondary-hover);
}

.reply-compose summary::-webkit-details-marker {
  display: none;
}

.reply-compose[open] {
  flex-basis: 100%;
  order: 2;
}

.reply-compose[open] summary {
  margin-bottom: 10px;
}

.reply-compose[open] .reply-form {
  width: 100%;
}

.reply-count {
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.stat-strip,
.item-stats {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stat-strip {
  margin: 0 0 14px;
}

.item-stats {
  margin: 0 0 12px;
}

.stat-strip span,
.item-stats span {
  background: #eef4f1;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-secondary);
  font-size: 0.82rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
}

.news-edit-form {
  display: grid;
  gap: 10px;
  padding-top: 10px;
}

.news-item p,
.markdown-content p,
.empty {
  margin: 0;
}

.markdown-content {
  display: grid;
  gap: 0.65rem;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  line-height: 1.25;
  margin: 0;
}

.markdown-content h1 {
  font-size: 1.3rem;
}

.markdown-content h2 {
  font-size: 1.18rem;
}

.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  font-size: 1.05rem;
}

.markdown-content blockquote {
  border-left: 4px solid var(--color-border);
  color: var(--color-secondary);
  margin: 0;
  padding: 0.15rem 0 0.15rem 0.8rem;
}

.markdown-content ol,
.markdown-content ul {
  margin: 0;
  padding-left: 1.35rem;
}

.markdown-content li {
  margin: 0.2rem 0;
}

.markdown-content li > p:only-child {
  display: inline;
}

.markdown-content input[type="checkbox"] {
  margin-right: 0.35rem;
  vertical-align: middle;
  width: auto;
}

.markdown-content .table-scroll {
  display: block;
  margin: 0;
  max-width: 100%;
  overflow-x: auto;
}

.markdown-content table {
  border-collapse: collapse;
  line-height: 1.25;
  min-width: 100%;
}

.markdown-content th,
.markdown-content td {
  border: 1px solid var(--color-border);
  padding: 0.45rem 0.55rem;
  vertical-align: top;
}

.markdown-content th {
  background: #eef4f1;
  font-weight: 800;
}

.markdown-content hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 0.25rem 0;
  width: 100%;
}

.markdown-content pre {
  background: #eef4f1;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin: 0;
  overflow-x: auto;
  padding: 0.75rem;
}

.markdown-content code {
  background: #eef4f1;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.08rem 0.28rem;
}

.markdown-content pre code {
  background: transparent;
  border: 0;
  border-radius: 0;
  display: block;
  padding: 0;
  white-space: pre;
}

.markdown-content img {
  border-radius: 8px;
  display: block;
  height: auto;
  max-width: 100%;
  width: auto;
}

.markdown-content a[href^="/uploads/"] {
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: inline-flex;
  gap: 0.4rem;
  margin: 0.15rem 0;
  padding: 0.45rem 0.65rem;
  text-decoration: none;
}

.markdown-content a[href^="/uploads/"]::before {
  content: "↓";
  font-weight: 800;
}

.news-item .audit-line,
.reply .audit-line {
  color: var(--color-muted);
  font-size: 0.88rem;
  margin: 0 0 10px;
}

.news-item a,
.reply a {
  color: var(--color-primary);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-panel {
  padding: 16px;
}

.admin-panel-top {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  margin: -2px -2px 16px;
  padding: 0 0 14px;
}

.admin-nav-toggle {
  min-width: 132px;
}

.admin-layout {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(200px, 250px) minmax(0, 1fr);
}

.admin-sidebar {
  align-self: start;
  border-right: 1px solid var(--color-border);
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 14px;
  position: sticky;
  top: 16px;
}

.admin-content {
  min-width: 0;
}

.admin-layout.nav-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.admin-layout.nav-collapsed .admin-sidebar {
  display: none;
}

.tabs {
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  background: transparent;
  border-radius: 8px 8px 0 0;
  color: var(--color-text);
  padding: 0.75rem 1rem;
}

.tab:hover,
.tab.active {
  background: var(--color-primary);
  color: #fff;
}

.admin-sidebar .tabs {
  border-bottom: 0;
  display: grid;
  gap: 6px;
  margin-bottom: 0;
  overflow-x: visible;
}

.admin-sidebar .tab {
  border-radius: 8px;
  justify-content: flex-start;
  padding: 0.75rem 0.85rem;
  text-align: left;
  white-space: normal;
  width: 100%;
}

.tab-panel {
  margin-top: 0;
}

.admin-news-header {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-news-header h2 {
  margin: 0;
}

.category-form {
  display: grid;
  gap: 14px;
}

.category-settings-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.category-settings-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
  padding: 14px;
}

.category-settings-item legend {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0 6px;
  text-transform: uppercase;
}

.category-color-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 54px 1fr 54px;
}

.category-color-row input[type="color"] {
  height: 44px;
  padding: 4px;
}

.replies {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
}

.reply {
  background: var(--color-bg);
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  padding: 10px;
}

.reply-meta {
  color: var(--color-muted);
  display: flex;
  font-size: 0.82rem;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.reply-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  min-width: 0;
}

.news-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.contact-panel {
  margin-top: 14px;
}

.contact-context {
  background: var(--color-bg);
  border-left: 4px solid var(--color-primary);
  border-radius: 8px;
  color: var(--color-muted);
  font-weight: 700;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.captcha-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.captcha-question {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  flex: 1;
  font-weight: 800;
  margin: 0;
  min-height: 42px;
  padding: 9px 12px;
}

.device-list {
  display: grid;
  gap: 12px;
}

.device-item {
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  padding: 16px;
}

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

.device-head h3,
.device-head p {
  margin: 0;
}

.device-head p {
  color: var(--color-muted);
  margin-top: 4px;
}

.device-details {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0;
}

.device-details div {
  min-width: 0;
}

.device-details dt {
  color: var(--color-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.device-details dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.user-more {
  margin-top: 10px;
}

.user-more summary {
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 800;
}

.user-more .device-details {
  margin-bottom: 0;
}

.user-agent {
  color: var(--color-muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .intro,
  .toolbar,
  .inline,
  .push-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-topline {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
  }

  .page-menu {
    margin-left: 0;
  }

  button,
  .admin-link {
    text-align: center;
    width: 100%;
  }

  .admin-actions .admin-link,
  .admin-news-actions button,
  .linked-page-link,
  .news-actions button,
  .pagination button,
  .site-footer a,
  .toolbar-actions button {
    width: auto;
  }

  .linked-page-link,
  .news-actions button {
    align-self: flex-start;
  }

  .pagination {
    justify-content: flex-start;
  }

  .pagination button {
    min-width: 40px;
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .markdown-toolbar {
    align-items: center;
    flex-direction: row;
  }

  .markdown-toolbar button {
    width: auto;
  }

  .icon-button {
    width: 44px;
  }

  .admin-news-header {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-shell {
    width: min(100% - 20px, 920px);
  }

  .admin-panel {
    padding: 14px;
  }

  .admin-panel-top {
    align-items: stretch;
    margin-bottom: 12px;
  }

  .admin-nav-toggle {
    width: 100%;
  }

  .admin-layout {
    display: block;
  }

  .admin-sidebar {
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
    max-height: min(65vh, 460px);
    padding: 8px;
    position: static;
  }

  .tabs {
    flex-direction: column;
    gap: 8px;
    overflow-x: visible;
  }

  .tab {
    border-radius: 8px;
  }

  .admin-sidebar .tabs {
    gap: 4px;
  }

  .admin-sidebar .tab {
    width: 100%;
  }

  .participant-images-head {
    align-items: stretch;
    flex-direction: column;
  }

  .image-submission-main {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .participant-email-form {
    align-items: stretch;
    flex-direction: column;
  }

  .participant-email-form button {
    width: 100%;
  }

  .participant-images-head button {
    width: 100%;
  }

  .magic-link-qr {
    width: 100%;
  }

  .device-head,
  .device-details,
  .category-settings-list,
  .category-color-row {
    grid-template-columns: 1fr;
  }

  .device-head {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-logo {
    height: 58px;
    width: 58px;
  }
}

.submission-panel .tabs,
.compact-tabs {
  margin-bottom: 14px;
}

.participant-form {
  margin-top: 12px;
}

.participant-admin-form {
  display: grid;
  gap: 10px;
}

.participant-email-form {
  align-items: center;
  display: flex;
  gap: 8px;
  max-width: 100%;
}

.participant-email-form input {
  min-width: 0;
}

.participant-email-form button {
  flex: 0 0 auto;
}

.submission-intro {
  color: var(--color-muted);
  margin: 0 0 8px;
}

.submission-deadline-info {
  background: #fff8ec;
  border: 1px solid #efd4a7;
  border-left: 5px solid var(--color-accent);
  border-radius: 8px;
  color: var(--color-text);
  margin: 0 0 14px;
  padding: 10px 12px;
}

.submission-panel .session-info {
  margin: 0 0 12px;
}



.participant-magic {
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-accent);
  border-radius: 8px;
  margin-top: 18px;
  padding: 14px;
}

.participant-magic h3,
.participant-magic p {
  margin: 0;
}

.participant-magic p {
  color: var(--color-muted);
  margin-top: 6px;
}

.magic-link-details {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.magic-link-details input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.magic-link-qr {
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  padding: 10px;
  width: max-content;
}

.magic-link-qr img {
  display: block;
  height: 180px;
  width: 180px;
}

.participant-image-section h4,
.participant-image-archive h4 {
  margin: 0 0 10px;
}

.participant-image-archive {
  margin-top: 16px;
}

.participant-image-day {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-top: 8px;
  padding: 10px;
}

.participant-image-day summary {
  color: var(--color-primary);
  cursor: pointer;
  font-weight: 800;
}

.participant-image-day .participant-image-list {
  margin-top: 10px;
}

.participant-images {
  border-top: 1px solid var(--color-border);
  margin-top: 18px;
  padding-top: 16px;
}

.participant-images-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.participant-images-head h3 {
  margin: 0;
}

.participant-image-list {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 180px));
}

.participant-image-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
}

.participant-image-item strong,
.participant-image-item p {
  overflow-wrap: anywhere;
}

.participant-image-item p {
  color: var(--color-muted);
  font-size: 0.88rem;
  margin: 4px 0 0;
}

.potd-to-rally-form {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.potd-to-rally-form .inline {
  align-items: stretch;
  gap: 0.45rem;
}

.potd-to-rally-form select,
.potd-to-rally-form button {
  width: 100%;
}

.participant-image-preview {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #eef4f1;
  border-radius: 6px;
  color: var(--color-muted);
  display: flex;
  font-size: 0.88rem;
  justify-content: center;
  overflow: hidden;
}

.participant-image-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-preview-button {
  border: 0;
  cursor: zoom-in;
  padding: 0;
}

.image-preview-button:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.image-lightbox {
  align-items: center;
  background: rgba(10, 19, 17, 0.88);
  bottom: 0;
  display: flex;
  justify-content: center;
  left: 0;
  padding: 1rem;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox-content {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  max-height: 92vh;
  max-width: min(1100px, 96vw);
}

.image-lightbox-content img {
  background: #0f1715;
  border-radius: 8px;
  max-height: 84vh;
  max-width: 100%;
  object-fit: contain;
}

.image-lightbox-content figcaption {
  color: #fff;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
  text-align: center;
}

.image-lightbox-close {
  align-items: center;
  background: #fff;
  border: 0;
  border-radius: 999px;
  color: #10211d;
  display: flex;
  font-size: 1.8rem;
  height: 44px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: 44px;
}

body.lightbox-open {
  overflow: hidden;
}


.image-submission-main {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 112px minmax(0, 1fr);
}

.image-submission-content {
  min-width: 0;
}

.image-submission-thumb {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #eef4f1;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.image-submission-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}


.submission-banner {
  align-items: center;
  background: #eef8f5;
  border: 1px solid #badbd2;
  border-left: 5px solid var(--color-primary);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 14px 16px;
}

.submission-banner p {
  margin: 4px 0 0;
}

.activation-code-item.open {
  border-left: 5px solid var(--color-success);
}

.activation-code-item.used {
  border-left: 5px solid var(--color-secondary);
}

.activation-code-form {
  margin-bottom: 14px;
}


.activation-code-copy {
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-success);
  border-radius: 8px;
  margin: 0 0 14px;
  padding: 14px;
}

.activation-code-copy h3,
.activation-code-copy p {
  margin: 0;
}

.activation-code-copy p {
  color: var(--color-muted);
  margin-top: 4px;
}

.activation-code-copy textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  margin-top: 10px;
  resize: vertical;
}

.photo-rally-area {
  margin-top: 1.25rem;
}

.photo-rally-area .participant-image-list {
  grid-template-columns: repeat(auto-fit, minmax(220px, 260px));
}

.photo-rally-progress-track {
  background: #e5ece8;
  border-radius: 999px;
  display: block;
  height: 8px;
  margin-top: 8px;
  max-width: 340px;
  overflow: hidden;
}

.photo-rally-progress-track span {
  background: var(--color-primary);
  display: block;
  height: 100%;
}

.photo-rally-task-head {
  align-items: start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.photo-rally-badge {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  white-space: nowrap;
}

.photo-rally-badge.open {
  background: #fff8ec;
  color: #8a4a14;
}

.photo-rally-badge.done,
.photo-rally-badge.submitted {
  background: #e8f5ee;
  color: #176b45;
}

.photo-rally-file-current,
.photo-rally-file-name {
  color: var(--color-muted);
  font-size: 0.88rem;
}

.photo-rally-file-input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.photo-rally-file-picker {
  align-items: center;
  background: var(--color-primary);
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
}

.photo-rally-file-input:focus + .photo-rally-file-picker {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.photo-rally-submit-panel {
  border-top: 1px solid var(--color-border);
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-top: 16px;
  padding-top: 14px;
}

.photo-rally-submit-panel p {
  color: var(--color-muted);
  margin: 0;
}

.photo-rally-submit-panel[data-ready="0"] p {
  display: none;
}

.photo-rally-form {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

.photo-rally-form textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.photo-rally-item .participant-image-preview span {
  text-align: center;
}

.submission-module-tabs {
  margin: 1rem 0;
}

.submission-module {
  min-width: 0;
}
