:root {
  --apps-bg: #eef2f5;
  --apps-surface: #ffffff;
  --apps-surface-soft: #f6f8fa;
  --apps-border: #d9e1e8;
  --apps-border-strong: #c5d0da;
  --apps-ink: #233746;
  --apps-ink-strong: #112b3d;
  --apps-muted: #5f7080;
  --apps-accent: #1b5978;
  --apps-accent-dark: #143d54;
  --apps-radius-sm: 8px;
  --apps-radius-md: 12px;
  --apps-shadow: 0 4px 14px rgba(16, 44, 64, 0.05);
}

body.apps-site {
  margin: 0;
  background: var(--apps-bg);
  color: var(--apps-ink);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.65;
}

body.apps-site * {
  box-sizing: border-box;
}

body.apps-site a {
  color: var(--apps-accent);
}

body.apps-site a:hover {
  color: var(--apps-accent-dark);
}

body.apps-site .app-menu {
  background: var(--apps-surface);
  border-bottom: 1px solid var(--apps-border);
  box-shadow: var(--apps-shadow);
}

body.apps-site .menu-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 10px 16px 10px;
}

body.apps-site .menu-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

body.apps-site .menu-branding {
  min-width: 0;
}

body.apps-site .menu-brand {
  display: inline-flex;
  align-items: center;
  color: var(--apps-ink-strong);
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

body.apps-site .menu-brand:hover {
  text-decoration: none;
}

body.apps-site .menu-subtitle {
  margin: 2px 0 0;
  max-width: 760px;
  color: var(--apps-muted);
  font-size: 0.88rem;
}

body.apps-site .menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.apps-site .menu-action,
body.apps-site .menu-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--apps-border);
  border-radius: 999px;
  background: var(--apps-surface-soft);
  color: var(--apps-ink-strong);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

body.apps-site .menu-action:hover,
body.apps-site .menu-link:hover {
  border-color: var(--apps-border-strong);
  background: #ffffff;
  text-decoration: none;
}

body.apps-site .menu-links {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

body.apps-site .menu-links::-webkit-scrollbar {
  height: 6px;
}

body.apps-site .menu-links::-webkit-scrollbar-thumb {
  background: #c8d4dd;
  border-radius: 999px;
}

body.apps-site .menu-link.is-active,
body.apps-site .menu-link[aria-current="page"] {
  background: var(--apps-accent);
  border-color: var(--apps-accent);
  color: #ffffff;
}

body.apps-site > header {
  max-width: 1220px;
  margin: 24px auto 0;
  padding: 0 16px;
}

body.apps-site > header h1,
body.apps-site .container h1,
body.apps-site .container h2 {
  margin: 0 0 10px;
  color: var(--apps-ink-strong);
  line-height: 1.22;
}

body.apps-site > header {
  background: var(--apps-surface);
  border: 1px solid var(--apps-border);
  border-left: 4px solid var(--apps-accent);
  border-radius: var(--apps-radius-md);
  padding: 22px;
  box-shadow: none;
}

body.apps-site > header p {
  margin: 0;
  max-width: 900px;
}

body.apps-site .container {
  max-width: 1220px;
  margin: 16px auto 48px;
  background: var(--apps-surface);
  border: 1px solid var(--apps-border);
  border-radius: var(--apps-radius-md);
  padding: 24px;
  box-shadow: none;
}

body.apps-site.theme-index .container {
  background: transparent;
  border: 0;
  padding: 0 16px 48px;
  margin-top: 16px;
}

body.apps-site .row {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 260px);
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 16px;
}

body.apps-site label {
  display: block;
  width: auto;
  margin: 0;
  color: var(--apps-ink-strong);
  font-weight: 700;
}

body.apps-site input[type="number"],
body.apps-site input[type="text"],
body.apps-site select {
  width: 100%;
  max-width: 260px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--apps-border);
  border-radius: var(--apps-radius-sm);
  background: #ffffff;
  color: var(--apps-ink);
  font-size: 1rem;
}

body.apps-site input[type="submit"],
body.apps-site input[type="button"],
body.apps-site button.primary {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--apps-accent);
  border-radius: var(--apps-radius-sm);
  background: var(--apps-accent);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}

body.apps-site input[type="submit"]:hover,
body.apps-site input[type="button"]:hover,
body.apps-site button.primary:hover {
  background: var(--apps-accent-dark);
  border-color: var(--apps-accent-dark);
}

body.apps-site input[type="checkbox"] {
  margin-right: 8px;
}

body.apps-site .field-help {
  grid-column: 2;
  margin: 0;
  color: var(--apps-muted);
  font-size: 0.88rem;
  max-width: 560px;
}

body.apps-site .results {
  background: var(--apps-surface-soft);
  border: 1px solid var(--apps-border);
  border-radius: var(--apps-radius-sm);
  padding: 18px;
  margin-top: 24px;
}

body.apps-site .results p {
  margin: 0 0 6px;
}

body.apps-site .results p:last-child {
  margin-bottom: 0;
}

body.apps-site .highlight {
  color: var(--apps-accent-dark);
  font-size: 1.12rem;
  font-weight: 800;
}

body.apps-site .note {
  margin-top: 24px;
  color: var(--apps-muted);
  font-size: 0.92rem;
}

body.apps-site hr {
  border: 0;
  border-top: 1px solid var(--apps-border);
  margin: 24px 0;
}

body.apps-site.theme-index .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1220px;
  margin: 16px auto 48px;
  padding: 0 16px;
}

body.apps-site.theme-index .card {
  background: var(--apps-surface);
  border: 1px solid var(--apps-border);
  border-radius: var(--apps-radius-md);
  padding: 20px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.apps-site.theme-index .card h2 {
  margin: 0;
  font-size: 1.14rem;
}

body.apps-site.theme-index .card p {
  margin: 0;
  flex: 1 1 auto;
}

body.apps-site.theme-index .card a {
  align-self: flex-start;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--apps-accent);
  border-radius: var(--apps-radius-sm);
  background: var(--apps-accent);
  color: #ffffff;
  text-decoration: none;
  font-weight: 700;
}

body.apps-site.theme-index .card a:hover {
  background: var(--apps-accent-dark);
  border-color: var(--apps-accent-dark);
  color: #ffffff;
}

@media (max-width: 860px) {
  body.apps-site .row {
    grid-template-columns: 1fr;
  }

  body.apps-site .field-help {
    grid-column: auto;
  }

  body.apps-site input[type="number"],
  body.apps-site input[type="text"],
  body.apps-site select {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  body.apps-site .menu-top {
    align-items: stretch;
  }

  body.apps-site .menu-actions {
    width: 100%;
  }

  body.apps-site .menu-action {
    flex: 1 1 auto;
  }

  body.apps-site > header,
  body.apps-site .container {
    padding: 18px;
  }

  body.apps-site.theme-index .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}
