:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #647282;
  --line: #dfe5ec;
  --accent: #11735f;
  --accent-strong: #0a5144;
  --accent-soft: #e7f3ef;
  --danger: #a82424;
  --ok: #17643b;
  --shadow: 0 18px 50px rgba(17, 32, 48, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #eaf2f0 0%, var(--bg) 280px),
    var(--bg);
  color: var(--text);
}

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.brand-hero {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

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

.brand-row h1 {
  font-size: 34px;
  letter-spacing: 0;
}

.language-switch {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 108px;
}

.language-switch button {
  width: 50px;
  height: 38px;
  padding: 9px 12px;
}

.language-switch button.active {
  background: var(--accent);
  color: #fff;
}

.ticker {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(17, 32, 48, 0.06);
}

.ticker p {
  display: inline-block;
  min-width: 100%;
  margin: 0;
  padding: 12px 16px;
  color: var(--accent-strong);
  font-weight: 800;
  white-space: nowrap;
  animation: ticker 18s linear infinite;
}

@keyframes ticker {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: 34px;
}

h2 {
  font-size: 20px;
}

.muted {
  color: var(--muted);
  line-height: 1.65;
}

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

.app-grid {
  align-items: stretch;
}

.app-grid .panel {
  min-height: 470px;
}

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

.section-head {
  display: grid;
  gap: 8px;
}

.notice-box {
  display: grid;
  gap: 6px;
  border: 1px solid #c6ded7;
  border-radius: 8px;
  padding: 16px;
  background: var(--accent-soft);
  min-height: 190px;
}

.notice-box strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.notice-box .muted {
  max-height: 180px;
  overflow: auto;
  color: #2f4a45;
  line-height: 1.76;
  padding-right: 4px;
}

.notice-box .muted p,
.guide-step,
.guide-note {
  margin: 0 0 8px;
}

.guide-step {
  position: relative;
  padding: 9px 11px 9px 13px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #ffffff;
  color: #203c36;
  box-shadow: 0 6px 16px rgba(17, 32, 48, 0.05);
}

.guide-note {
  padding: 9px 11px;
  border-radius: 6px;
  background: rgba(17, 115, 95, 0.08);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(17, 115, 95, 0.08);
}

.notice-box a {
  color: #0b5fcd;
  font-weight: 800;
  text-decoration: none;
  word-break: break-all;
}

.notice-box a:hover {
  text-decoration: underline;
}

.inline-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
}

.inline-field button {
  white-space: nowrap;
}

label {
  display: grid;
  gap: 8px;
  color: #263442;
  font-size: 14px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--text);
  background: #fff;
  font: inherit;
  min-height: 46px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(17, 115, 95, 0.14);
  outline: none;
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  min-height: 46px;
  transition: transform 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 22px rgba(17, 115, 95, 0.18);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
  box-shadow: none;
}

.primary-action {
  width: 100%;
}

.secondary {
  background: #e9eef3;
  color: #17202a;
}

.secondary:hover {
  background: #dce4ec;
}

.result {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

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

.result.ok {
  color: var(--ok);
}

.status-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfcfd;
  line-height: 1.7;
  min-height: 138px;
}

.toolbar {
  display: flex;
  gap: 12px;
  margin: 0 0 20px;
}

.toolbar button,
.toolbar select {
  width: auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.row-actions button,
.row-actions a {
  border-radius: 6px;
  padding: 8px 10px;
  background: #edf2f6;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.settings-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid button,
.settings-grid .result {
  grid-column: 1 / -1;
}

dialog {
  width: min(640px, calc(100% - 24px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
}

dialog::backdrop {
  background: rgba(12, 24, 36, 0.55);
}

.dialog-form {
  padding: 24px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding: 20px 0;
  }

  .intro,
  .grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .intro {
    display: grid;
  }

  .brand-row,
  .inline-field {
    grid-template-columns: 1fr;
    display: grid;
  }

  .language-switch {
    justify-self: start;
  }

  h1 {
    font-size: 28px;
  }
}
