:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #e9ece7;
  color: #1f2528;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #1f2528;
  --muted: #657078;
  --line: #d5dad4;
  --panel: #fbfcf8;
  --panel-strong: #ffffff;
  --green: #2f725f;
  --teal: #0f7b86;
  --blue: #3e6c98;
  --gold: #a4681b;
  --red: #a13d3d;
  --violet: #7060a8;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(47, 114, 95, 0.45);
  outline-offset: 2px;
}

svg {
  width: 18px;
  height: 18px;
  display: block;
}

[data-icon] {
  display: inline-grid;
  place-items: center;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 64px 1fr;
  background:
    linear-gradient(90deg, rgba(31, 37, 40, 0.04) 1px, transparent 1px),
    #e9ece7;
  background-size: 24px 24px;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px 10px;
  background: #243033;
  color: #eef2ea;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 8px;
  background: #f3b85a;
  color: #1f2528;
  font-weight: 800;
}

.brand-mark img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
}

.rail-button,
.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  color: inherit;
}

.rail-button:hover,
.rail-button.active {
  background: rgba(255, 255, 255, 0.14);
}

.workspace {
  padding: 18px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.topbar {
  min-height: 66px;
  display: grid;
  grid-template-columns: 240px minmax(360px, 1fr) auto;
  align-items: center;
  gap: 18px;
}

.kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
  line-height: 1.25;
}

.global-search {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.global-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.topbar .icon-button,
.queue-pane .icon-button,
.inspector-pane .icon-button {
  color: var(--ink);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.icon-button.quiet {
  background: transparent;
  border: 0;
  color: var(--muted);
}

.primary-action,
.secondary-action,
.tool-button,
.filter-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 700;
}

.page {
  display: none;
}

.page.active-page {
  display: block;
}

.panel,
.dashboard-map-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.primary-action {
  background: #1f5e4e;
  color: #ffffff;
  border-color: #1f5e4e;
}

.secondary-action {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 700;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.metric svg {
  color: var(--green);
}

.metric.audio svg {
  color: var(--teal);
}

.metric.pack svg {
  color: var(--gold);
}

.metric.manifest svg {
  color: var(--blue);
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.work-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 330px minmax(520px, 1fr) 340px;
  gap: 14px;
  min-height: 720px;
}

.two-column-page {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) minmax(360px, 0.65fr);
  gap: 14px;
  min-height: 680px;
}

.three-column-page {
  display: grid;
  grid-template-columns: minmax(360px, 0.95fr) minmax(300px, 0.78fr) minmax(340px, 0.82fr);
  gap: 14px;
  min-height: 680px;
}

.queue-pane,
.editor-pane,
.inspector-pane {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.queue-pane,
.inspector-pane {
  padding: 14px;
}

.pane-heading,
.editor-header,
.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
}

.filter-row.compact {
  align-items: end;
  margin: 0;
}

.filter-row.compact label {
  min-width: 128px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.queue-search {
  margin-top: 14px;
}

.package-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

select {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}

.filter-button {
  height: 34px;
  color: var(--muted);
  font-size: 13px;
}

.story-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-map-panel {
  min-height: 646px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-map {
  position: relative;
  flex: 1;
  min-height: 510px;
  overflow: hidden;
  border: 1px solid #cad5d2;
  border-radius: 8px;
  background: #dfe4e0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.overview-map:active {
  cursor: grabbing;
}

.overview-map::after,
.osm-map::after {
  content: "OpenStreetMap";
  position: absolute;
  right: 8px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.overview-pin-layer {
  position: absolute;
  inset: 0;
}

.overview-map-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  display: grid;
  gap: 5px;
}

.overview-map-controls .icon-button {
  background: rgba(255, 255, 255, 0.94);
  font-size: 20px;
  font-weight: 800;
}

.overview-pin {
  position: absolute;
  z-index: 3;
  width: 18px;
  height: 18px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 8px 20px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.overview-pin span {
  position: absolute;
  left: 18px;
  top: -6px;
  min-width: 150px;
  max-width: 220px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  opacity: 0;
  pointer-events: none;
}

.overview-pin:hover span,
.overview-pin:focus-visible span {
  opacity: 1;
}

.dashboard-map-footer {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.dashboard-map-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-legend i {
  width: 11px;
  height: 11px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.empty-state {
  min-height: 96px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  text-align: center;
}

.story-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  gap: 8px;
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.story-item.selected {
  border-color: #6aa58e;
  box-shadow: inset 3px 0 0 #2f725f;
}

.story-item:hover,
.package-line:hover,
.audio-row:hover {
  border-color: #9ab6aa;
}

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

.story-title-row h3 {
  min-width: 0;
}

.story-item p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.story-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.story-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.state-pill,
.status-pill {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.state-pill.review {
  background: #f3e2c4;
  color: #7d4e13;
}

.state-pill.draft,
.status-pill.draft {
  background: #dbe7ec;
  color: #2c5a6c;
}

.state-pill.published,
.status-pill.published {
  background: #d8eadf;
  color: #246246;
}

.state-pill.archived {
  background: #e3e3e3;
  color: #5a5a5a;
}

.editor-pane {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.language-switch {
  margin-left: auto;
  display: inline-grid;
  grid-template-columns: repeat(2, 44px);
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1ec;
}

.language-switch button {
  height: 30px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.language-switch button.active {
  background: var(--panel-strong);
  color: var(--ink);
}

.title-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 10px;
}

.story-title-field input {
  height: 48px;
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
}

.story-summary-field input {
  height: 46px;
  font-size: 17px;
  font-weight: 400;
}

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

.story-use-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.story-use-switch {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef1ec;
}

.story-use-switch button {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.story-use-switch button.active {
  background: var(--panel-strong);
  color: var(--ink);
}

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
}

input {
  height: 40px;
  padding: 0 11px;
}

textarea {
  min-height: 260px;
  resize: vertical;
  padding: 13px;
  line-height: 1.52;
  font-size: 15px;
  font-weight: 400;
}

.text-editor-label {
  border-radius: 8px;
}

.field-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.editor-tools {
  display: flex;
  gap: 8px;
}

.tool-button {
  height: 36px;
  font-size: 13px;
}

.map-audio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.map-panel,
.audio-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  padding: 12px;
}

.subheading {
  justify-content: flex-start;
  margin-bottom: 10px;
}

.subheading svg {
  color: var(--green);
}

.route-preview {
  position: relative;
  height: 164px;
  overflow: hidden;
  border: 1px solid #cad5d2;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(42, 102, 111, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(42, 102, 111, 0.12) 1px, transparent 1px),
    #dfe9e4;
  background-size: 28px 28px;
}

.osm-map {
  position: relative;
  height: 244px;
  overflow: hidden;
  border: 1px solid #cad5d2;
  border-radius: 8px;
  background: #dfe4e0;
  touch-action: none;
  user-select: none;
  cursor: grab;
}

.osm-map.dragging {
  cursor: grabbing;
}

.osm-tiles {
  position: absolute;
  inset: 0;
}

.osm-tiles img {
  position: absolute;
  width: 256px;
  height: 256px;
  filter: grayscale(1) contrast(1.08) brightness(1.02);
  opacity: 0.82;
}

.osm-map::after {
}

.map-zone-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-zone-overlay path {
  fill: rgba(47, 114, 95, 0.18);
  stroke: rgba(47, 114, 95, 0.9);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.map-pin {
  position: absolute;
  z-index: 5;
  width: 22px;
  height: 22px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2), 0 10px 24px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
  cursor: move;
}

.trigger-map-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 6;
  display: flex;
  gap: 5px;
}

.trigger-map-controls .icon-button {
  background: rgba(255, 255, 255, 0.92);
}

.geometry-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.geometry-controls label {
  gap: 6px;
  padding: 8px;
  border-radius: 8px;
  background: #f0f4ee;
}

.geometry-controls input[type="range"] {
  height: 20px;
  padding: 0;
  accent-color: var(--green);
  background: transparent;
}

.geometry-controls strong {
  color: var(--ink);
  font-size: 12px;
}

.zone-note,
.coordinate-note {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.coordinate-note {
  font-weight: 800;
}

.road {
  position: absolute;
  height: 15px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 0 1px #bbc8c2;
}

.road.horizontal {
  width: 85%;
  left: 6%;
  top: 88px;
}

.road.diagonal {
  width: 74%;
  left: 24%;
  top: 66px;
  transform: rotate(-28deg);
}

.trigger-zone {
  position: absolute;
  width: 84px;
  height: 84px;
  left: 45%;
  top: 41px;
  border: 2px solid rgba(47, 114, 95, 0.78);
  border-radius: 50%;
  background: rgba(47, 114, 95, 0.12);
}

.pin {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
}

.pin.start {
  left: 18%;
  top: 84px;
}

.pin.end {
  right: 18%;
  top: 48px;
  background: var(--green);
}

.geometry-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.geometry-grid span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px;
  border-radius: 8px;
  background: #f0f4ee;
  color: var(--muted);
  font-size: 12px;
}

.geometry-grid strong {
  color: var(--ink);
}

.audio-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 56px;
  padding: 0;
  border-top: 1px solid var(--line);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.audio-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.audio-voice-picker {
  width: 136px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audio-voice-picker select {
  height: 36px;
  margin-top: 3px;
}

.audio-chapter-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audio-editor-grid {
  display: grid;
  gap: 8px;
}

.audio-workbench {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f4ee;
}

.audio-workbench.empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audio-player-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-player-heading span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-player-controls,
.audio-progress {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-player-controls {
  flex-wrap: wrap;
}

.audio-progress span {
  width: 34px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.audio-progress input {
  flex: 1;
  height: 22px;
  padding: 0;
  accent-color: var(--green);
  background: transparent;
}

.audio-waveform {
  height: 58px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: pointer;
}

.audio-waveform span {
  flex: 1;
  min-width: 2px;
  border-radius: 2px;
  background: #aabdb6;
  transition: background 100ms ease;
}

.audio-waveform span.played {
  background: var(--green);
}

.audio-waveform.disabled {
  opacity: 0.48;
  cursor: default;
}

.audio-volume {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-volume svg {
  width: 16px;
  height: 16px;
  color: var(--green);
}

.audio-volume input {
  flex: 1;
  height: 20px;
  padding: 0;
  accent-color: var(--green);
  background: transparent;
}

.audio-player-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.audio-file-main {
  display: grid;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.audio-row.selected {
  background: #edf5ed;
}

.mini-action.icon-only {
  width: 30px;
  justify-content: center;
  padding: 5px;
}

.mini-action {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.mini-action:disabled {
  opacity: 0.44;
  cursor: not-allowed;
}

.audio-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audio-part {
  min-width: 88px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.audio-part strong,
.audio-part span {
  display: block;
}

.audio-part span {
  color: var(--muted);
  font-size: 11px;
}

.audio-row:first-of-type {
  border-top: 0;
}

.audio-row svg {
  color: var(--teal);
}

.audio-row.pending svg {
  color: var(--gold);
}

.audio-row.published svg {
  color: var(--green);
}

.audio-row strong,
.audio-row span {
  display: block;
}

.audio-row span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.inspector-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.control-section {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.control-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.control-section h3 svg {
  color: var(--green);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.workflow-steps span {
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef1ec;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-steps span.done {
  background: #d8eadf;
  color: #246246;
}

.access-options,
.toggle-list {
  display: grid;
  gap: 8px;
}

.access-options label,
.toggle-list label {
  min-height: 38px;
  display: grid;
  grid-template-columns: 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 13px;
}

.access-options input,
.toggle-list input {
  width: 36px;
  height: 20px;
  accent-color: var(--green);
}

.package-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  margin-top: 8px;
  overflow-y: auto;
  padding-right: 3px;
}

.package-line,
.auto-state {
  display: grid;
  grid-template-columns: 1fr 24px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  text-align: left;
}

.package-line.active {
  border-color: #7eb096;
}

.package-line strong,
.package-line span,
.auto-state strong,
.auto-state span {
  display: block;
}

.package-line span,
.auto-state span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.auto-state {
  grid-template-columns: 28px 1fr;
}

.auto-state svg {
  color: var(--blue);
}

.manifest-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.manifest-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 30px;
  border-bottom: 1px solid var(--line);
}

.manifest-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.manifest-list dd {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.package-overview,
.product-rules,
.publication-summary,
.publication-access-map,
.publication-list,
.user-table,
.role-matrix,
.settings-grid,
.login-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.package-card,
.rule-card,
.publication-row,
.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 62px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.package-card {
  cursor: default;
}

.package-card.selected {
  border-color: #6aa58e;
  box-shadow: inset 3px 0 0 #2f725f;
}

.rule-card {
  grid-template-columns: 1fr;
}

.publication-row code {
  padding: 5px 7px;
  border-radius: 6px;
  background: #eef1ec;
  color: var(--muted);
  font-size: 12px;
}

.publication-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.release-stat {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.release-stat strong {
  display: block;
  font-size: 22px;
}

.release-stat span {
  color: var(--muted);
  font-size: 12px;
}

.catalog-package-row {
  grid-template-columns: minmax(0, 1fr) 140px;
}

.publication-price {
  text-align: right;
}

.publication-price strong,
.publication-price span {
  display: block;
}

.publication-price span {
  color: var(--muted);
  font-size: 12px;
}

.package-card p,
.rule-card span,
.publication-row span,
.user-row span,
.user-row em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.tag-list,
.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef1ec;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.price-box {
  text-align: right;
}

.price-box strong,
.price-box span {
  display: block;
}

.price-box span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.permission-grid label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
}

.permission-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--green);
}

.package-editor {
  display: grid;
  gap: 12px;
}

.package-free-toggle {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 13px;
}

.package-free-toggle input {
  width: 36px;
  height: 20px;
  accent-color: var(--green);
}

.package-story-section {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

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

.package-content-section h3,
.package-story-section h3 {
  margin: 0;
  font-size: 14px;
}

.package-contents {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.package-content-note {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.package-story-list {
  display: grid;
  gap: 7px;
}

.package-story-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.package-story-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.package-story-actions {
  display: flex;
  gap: 4px;
}

.package-editor textarea {
  min-height: 110px;
  font-size: 13px;
}

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

.package-tag-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.editable-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editable-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef1ec;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.editable-tag span {
  color: var(--red);
}

.muted-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.role-tags span {
  margin: 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef1ec;
  font-weight: 800;
}

.settings-grid label,
.login-preview label {
  gap: 7px;
}

.admin-workspace {
  display: grid;
  grid-template-columns: minmax(430px, 0.95fr) minmax(480px, 1.05fr);
  gap: 12px;
}

.user-row {
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.user-row.selected {
  border-color: #6aa58e;
  box-shadow: inset 3px 0 0 #2f725f;
}

.user-row em {
  justify-self: end;
  font-style: normal;
  font-weight: 800;
}

.status-ok {
  color: var(--green) !important;
}

.status-off {
  color: var(--red) !important;
}

.professional-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.professional-form label,
.professional-form fieldset {
  display: grid;
  gap: 7px;
}

.professional-form fieldset {
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.professional-form legend,
.professional-form span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.professional-form small {
  font-weight: 600;
}

.switch-row {
  min-height: 42px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.switch-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.form-actions,
.login-inline,
.form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.form-grid > label {
  flex: 1 1 160px;
}

.danger-action {
  color: var(--red);
}

.login-test {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.login-inline input {
  flex: 1 1 150px;
}

.login-result {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
}

.login-result.success {
  color: var(--green);
}

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

[hidden] {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  align-items: center;
  gap: clamp(30px, 7vw, 110px);
  padding: clamp(28px, 6vw, 96px);
  background:
    linear-gradient(rgba(244, 247, 242, 0.94), rgba(244, 247, 242, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(42, 78, 70, 0.08) 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(42, 78, 70, 0.08) 23px 24px);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 24px;
}

.login-brand img {
  width: 224px;
  height: 224px;
}

.login-brand .kicker {
  font-size: 18px;
  line-height: 1.1;
}

.login-brand h1 {
  max-width: 420px;
  margin: 4px 0 0;
  font-size: clamp(36px, 5vw, 62px);
  line-height: 1;
}

.login-panel {
  width: min(100%, 480px);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 18px 42px rgba(31, 58, 53, 0.14);
}

.login-panel h2 {
  margin: 4px 0 10px;
}

.login-panel label {
  display: grid;
  gap: 7px;
}

.login-panel label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-panel input {
  min-height: 44px;
}

.password-field {
  position: relative;
}

.password-field input {
  width: 100%;
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 34px;
  height: 34px;
  display: grid;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  place-items: center;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--accent);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.google-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.google-action:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.current-user {
  max-width: 220px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 760px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-content: center;
  }

  .login-brand h1 {
    font-size: 38px;
  }

  .login-brand img {
    width: 132px;
    height: 132px;
  }

  .login-brand .kicker {
    font-size: 15px;
  }
}

.system-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.system-summary article {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f0f4ee;
}

.system-summary span,
.security-note {
  color: var(--muted);
  font-size: 12px;
}

.system-summary strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-section-heading {
  padding-top: 4px;
}

.form-section-heading h3 {
  margin: 2px 0 0;
}

.security-note {
  margin: 0;
  line-height: 1.45;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  min-width: 240px;
  max-width: 360px;
  padding: 12px 14px;
  border: 1px solid #1f5e4e;
  border-radius: 8px;
  background: #20302d;
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 16px 40px rgba(31, 37, 40, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(31, 37, 40, 0.34);
}

.modal {
  width: min(680px, calc(100vw - 48px));
  max-height: calc(100vh - 80px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: 0 24px 70px rgba(31, 37, 40, 0.28);
}

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

.modal-heading .icon-button svg {
  transform: rotate(45deg);
}

.modal pre {
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #f0f4ee;
  overflow: auto;
  line-height: 1.45;
  font-size: 13px;
}

.ai-chat-modal {
  width: min(760px, calc(100vw - 48px));
}

.ai-chat-context {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f0f4ee;
  color: var(--muted);
  font-size: 13px;
}

.ai-chat-messages {
  display: grid;
  gap: 9px;
  min-height: 220px;
  max-height: 42vh;
  margin: 12px 0;
  overflow: auto;
}

.ai-chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
}

.ai-chat-message.user {
  justify-self: end;
  background: #edf5ed;
}

.ai-chat-message.error {
  border-color: #d6a37a;
  background: #fff4e8;
}

.ai-chat-message p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.ai-chat-message .mini-action {
  margin-top: 9px;
}

.ai-chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px;
}

.ai-chat-form textarea {
  min-height: 86px;
}

@media (max-width: 1300px) {
  .work-grid {
    grid-template-columns: 300px minmax(480px, 1fr);
  }

  .inspector-pane {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 54px 1fr;
  }

  .workspace {
    padding: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
  }

  .status-strip,
  .work-grid,
  .two-column-page,
  .three-column-page,
  .admin-workspace,
  .map-audio-grid,
  .title-fields {
    grid-template-columns: 1fr;
  }

  .filter-row.compact,
  .filter-grid,
  .package-filter-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .audio-editor-grid {
    grid-template-columns: 1fr;
  }

  .filter-row.compact label {
    min-width: 0;
  }

  .overview-map {
    min-height: 420px;
  }
}
