:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f4f1;
  --line: #d9ded8;
  --line-strong: #bcc7bf;
  --text: #17201b;
  --muted: #68736d;
  --green: #2f7d57;
  --green-dark: #1f5f41;
  --blue: #2f63a3;
  --yellow: #b57b19;
  --red: #a34444;
  --shadow: 0 18px 55px rgba(36, 45, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

.view-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.view-tab {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.view-tab:hover,
.view-tab.active {
  border-color: rgba(47, 125, 87, 0.32);
  background: #fff;
  color: var(--green-dark);
}

.view-panel {
  display: none;
}

.view-panel.is-active {
  display: block;
}

h2 {
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: 0;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(47, 125, 87, 0.22);
  border-radius: 8px;
  background: rgba(47, 125, 87, 0.08);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(246, 248, 246, 0.92);
  backdrop-filter: blur(4px);
}

.login-card {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(22, 35, 28, 0.18);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.login-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.login-card .form-field {
  margin-bottom: 12px;
}

.login-card select,
.manager-filter-select {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.login-card select {
  width: 100%;
  padding: 0 12px;
}

.manager-filter-select {
  min-width: 220px;
  padding: 0 10px;
  font-weight: 700;
}

.action-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
}

.action-button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.action-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.secondary-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.secondary-button:hover {
  border-color: var(--green);
  color: var(--green-dark);
}

.link-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.compact-button {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.google-panel {
  margin-bottom: 14px;
}

.drafts-panel {
  margin-bottom: 14px;
}

.google-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.5fr) minmax(260px, 2fr);
  gap: 10px;
  padding: 14px 16px;
}

.google-info {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.google-info strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.15;
}

.wb-plan-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.plan-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 16px;
}

.plan-toolbar .muted-text {
  flex: 1 1 260px;
}

.plan-summary-grid {
  margin: 0;
  padding: 0 16px;
}

.plan-comparison-wrap,
.plan-issues-wrap {
  margin: 0 16px;
}

.plan-comparison-table {
  table-layout: fixed;
}

.plan-comparison-table th:first-child,
.plan-comparison-table td:first-child {
  width: 34%;
}

.plan-comparison-table td:not(:first-child) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.plan-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}

.plan-issues-wrap {
  margin-bottom: 16px;
  max-height: 460px;
  overflow: auto;
}

.plan-issues-wrap td:last-child {
  min-width: 360px;
  white-space: normal;
}

.infographics-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.infographics-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.infographics-toolbar .draft-search-wrap {
  flex: 1 1 260px;
}

.infographics-toolbar select {
  flex: 0 1 220px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.infographics-photo-list-wrap {
  flex: 0 1 160px;
}

.infographics-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.infographics-bulk textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.infographics-bulk .action-button {
  align-self: start;
  min-height: 42px;
}

.infographics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.infographics-details,
.infographics-preview {
  min-width: 0;
}

.infographics-preview-frame {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px;
}

.infographics-preview-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 640px;
  object-fit: contain;
}

.infographics-gallery {
  width: 100%;
  max-height: calc(100vh - 270px);
  min-height: 360px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  align-content: start;
  padding-right: 4px;
}

.infographics-gallery-card {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.infographics-gallery-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 125, 87, 0.18);
}

.infographics-gallery-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.infographics-gallery-card img {
  width: 100%;
  max-height: none;
  border-radius: 6px;
}
.infographics-preview-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.infographics-preview-stage img {
  user-select: none;
  pointer-events: none;
}

.infographics-layout-block {
  position: absolute;
  min-width: 18%;
  padding: 10px 18px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 2px dashed rgba(47, 125, 87, 0.8);
  color: #300a03;
  font-weight: 600;
  text-align: center;
  line-height: 1.16;
  cursor: move;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
  touch-action: none;
  white-space: pre-wrap;
}

.infographics-layout-block.is-dragging {
  border-style: solid;
  box-shadow: 0 12px 28px rgba(47, 125, 87, 0.24);
}

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

.infographics-source-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.infographics-source-grid h3,
.infographics-rules h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.infographics-source-grid p {
  margin: 4px 0;
  color: var(--muted);
}

.infographics-rules {
  margin-top: 14px;
}

.infographics-registry {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  overflow-x: auto;
}

.infographics-registry h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.infographics-registry .data-table {
  min-width: 760px;
}

.infographics-registry .muted-text {
  display: inline-block;
  max-width: 280px;
}

.infographics-link-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.success-box .infographics-link-actions {
  display: flex;
  margin-top: 8px;
}

.success-box .infographics-link-actions a {
  margin-left: 0;
}

.expected-columns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}

.column-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.column-chip.available {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.08);
  color: var(--green-dark);
}

.column-chip.missing {
  border-color: rgba(181, 123, 25, 0.3);
  background: rgba(181, 123, 25, 0.1);
  color: var(--yellow);
}

.drafts-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px;
}

.draft-info {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.draft-info strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
}

.draft-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.6fr) minmax(320px, 0.9fr);
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.draft-search-wrap input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.draft-search-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 87, 0.12);
}

.draft-filter-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 2px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.filter-chip strong {
  color: var(--text);
  font-size: 13px;
}

.filter-chip:hover,
.filter-chip.active {
  border-color: rgba(47, 125, 87, 0.42);
  background: rgba(47, 125, 87, 0.08);
  color: var(--green-dark);
}

.filter-chip-wb {
  border-color: rgba(47, 125, 87, 0.28);
}

.filter-chip-wb strong {
  color: var(--green-dark);
}

.bulk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
}

.bulk-actions button {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 6px 10px;
  line-height: 1.15;
  white-space: normal;
}

.draft-workbench {
  display: grid;
  grid-template-columns: minmax(540px, 0.9fr) minmax(520px, 1.1fr);
  gap: 12px;
  padding: 12px 16px 16px;
}

.draft-list-pane,
.draft-editor-pane {
  min-width: 0;
}

.draft-editor-pane {
  position: sticky;
  top: 12px;
  align-self: start;
}

.draft-queue-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.drafts-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.drafts-breakdown,
.drafts-rules {
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.draft-mini-row,
.rule-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.draft-mini-row:first-child,
.rule-line:first-of-type {
  padding-top: 0;
}

.draft-mini-row:last-child,
.rule-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.draft-mini-row span,
.rule-line span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.draft-mini-row strong,
.rule-line b {
  font-size: 13px;
}

.draft-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.draft-issues {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.draft-warning {
  color: var(--yellow);
}

.drafts-table-wrap {
  max-height: 520px;
  margin: 0 16px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.workbench-panel .drafts-grid {
  display: none;
}

.workbench-panel .draft-info {
  min-height: 66px;
  padding: 10px;
}

.workbench-panel .draft-info strong {
  font-size: 20px;
}

.workbench-panel .drafts-body {
  display: none;
}

.workbench-panel .drafts-breakdown,
.workbench-panel .drafts-rules {
  min-height: 96px;
  padding: 10px;
}

.workbench-panel .drafts-table-wrap {
  max-height: calc(100vh - 268px);
  min-height: 560px;
  margin: 0;
}

.drafts-table th,
.drafts-table td {
  vertical-align: top;
}

.drafts-table .select-column {
  width: 40px;
  text-align: center;
}

.drafts-table .select-column input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  cursor: pointer;
}

.drafts-table th:nth-child(1),
.drafts-table td:nth-child(1) {
  width: 40px;
}

.drafts-table th:nth-child(2),
.drafts-table td:nth-child(2) {
  width: 72px;
}

.drafts-table th:nth-child(3),
.drafts-table td:nth-child(3) {
  width: 210px;
}

.drafts-table th:nth-child(6),
.drafts-table td:nth-child(6) {
  width: 300px;
}

.drafts-table th:nth-child(7),
.drafts-table td:nth-child(7) {
  width: 280px;
}

.drafts-table th:nth-child(8),
.drafts-table td:nth-child(8) {
  width: 112px;
}

.draft-table-issues {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

tr.draft-row {
  cursor: pointer;
}

tr.draft-row:hover,
tr.draft-row.selected {
  background: rgba(47, 125, 87, 0.08);
}

tr.draft-row.locked-by-other {
  background: rgba(183, 129, 36, 0.08);
}

.draft-row .badge {
  margin-top: 6px;
}

.draft-wb-cell {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  min-width: 96px;
}

.wb-status-note {
  max-width: 150px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.draft-article-cell {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.draft-article-text {
  min-width: 0;
  overflow: hidden;
}

.draft-article-text strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  line-height: 1.2;
}

.draft-wb-article {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.draft-sizes-cell {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.draft-photo-thumb {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f6f4;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.draft-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.draft-photo-thumb .thumb-fallback {
  width: 100%;
  height: 100%;
  place-items: center;
}

.draft-photo-thumb .thumb-fallback:not([hidden]) {
  display: grid;
}

.draft-photo-thumb.has-preview {
  background: #fff;
  border-color: rgba(47, 125, 87, 0.3);
}

.draft-photo-thumb.has-source {
  border-color: rgba(181, 123, 25, 0.3);
  background: rgba(181, 123, 25, 0.08);
  color: #7a4f0d;
}

.draft-photo-thumb.missing {
  border-style: dashed;
}

.draft-editor {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.editor-lock-warning {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border: 1px solid rgba(183, 129, 36, 0.28);
  border-radius: 8px;
  background: rgba(183, 129, 36, 0.08);
  color: #7a4f0d;
  font-size: 13px;
  font-weight: 700;
}

.workbench-panel .draft-editor {
  height: calc(100vh - 146px);
  min-height: 640px;
  margin: 0;
  overflow: auto;
}

.workbench-panel .drafts-table th:nth-child(6),
.workbench-panel .drafts-table td:nth-child(6) {
  display: none;
}

.workbench-panel .drafts-table th:nth-child(1),
.workbench-panel .drafts-table td:nth-child(1) {
  width: 40px;
}

.workbench-panel .drafts-table th:nth-child(2),
.workbench-panel .drafts-table td:nth-child(2) {
  width: 56px;
}

.workbench-panel .drafts-table th:nth-child(3),
.workbench-panel .drafts-table td:nth-child(3) {
  width: 172px;
}

.workbench-panel .drafts-table th:nth-child(7),
.workbench-panel .drafts-table td:nth-child(7) {
  width: 160px;
}

.workbench-panel .drafts-table th:nth-child(8),
.workbench-panel .drafts-table td:nth-child(8) {
  width: 104px;
}

.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
}

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

.editor-issues {
  display: grid;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(163, 68, 68, 0.06);
  color: var(--red);
  font-size: 12px;
  line-height: 1.35;
}

.editor-system-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(47, 99, 163, 0.05);
}

.wb-diff-panel {
  margin: 12px 16px;
  padding: 12px;
  border: 1px solid #e8c87d;
  border-radius: 8px;
  background: #fff8e7;
}

.wb-diff-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.wb-diff-list {
  display: grid;
  gap: 8px;
}

.wb-diff-row {
  display: grid;
  gap: 3px;
  font-size: 13px;
  line-height: 1.35;
}

.wb-diff-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.editor-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.workbench-panel .editor-section {
  padding: 14px;
}

.editor-section:last-child {
  border-bottom: 0;
}

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

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

.editor-section-heading h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

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

.editor-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field span,
.wb-characteristic-field span b {
  font-size: 12px;
  font-weight: 800;
}

.form-field input,
.form-field textarea,
.editor-table input,
.wb-characteristic-field input {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.form-field textarea {
  resize: vertical;
  line-height: 1.4;
}

.pricing-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 125, 87, 0.24);
  border-radius: 8px;
  background: rgba(47, 125, 87, 0.06);
}

.pricing-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pricing-panel-heading h4 {
  margin: 0 0 4px;
  font-size: 14px;
  line-height: 1.2;
}

.pricing-panel-heading span,
.pricing-item span,
.pricing-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.pricing-panel-heading > strong {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  white-space: nowrap;
}

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

.pricing-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.pricing-item strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.pricing-item-result {
  border-color: rgba(47, 125, 87, 0.35);
}

.pricing-warning {
  display: grid;
  gap: 6px;
}

.pricing-warning span {
  padding: 8px 10px;
  border: 1px solid rgba(181, 123, 25, 0.3);
  border-radius: 8px;
  background: rgba(181, 123, 25, 0.08);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.ai-result-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 99, 163, 0.22);
  border-radius: 8px;
  background: rgba(47, 99, 163, 0.06);
}

.ai-result-meta,
.ai-result-list,
.ai-result-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-result-meta span,
.ai-result-list span,
.ai-result-warnings span {
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
}

.ai-result-warnings span {
  border-color: rgba(181, 123, 25, 0.3);
  background: rgba(181, 123, 25, 0.08);
  color: var(--yellow);
}

.form-field input:focus,
.form-field textarea:focus,
.editor-table input:focus,
.wb-characteristic-field input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 87, 0.12);
}

.readonly-field input,
.editor-table input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.editor-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-table {
  width: 100%;
  border-collapse: collapse;
}

.editor-table th,
.editor-table td {
  padding: 8px;
}

.editor-table th:nth-child(1) {
  width: 160px;
}

.editor-table th:nth-child(2),
.editor-table th:nth-child(3) {
  width: 140px;
}

.wb-characteristics-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.workbench-panel .wb-characteristics-form {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.wb-characteristic-field {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wb-characteristic-field.filled {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.05);
}

.wb-characteristic-field.dictionary-ok {
  border-color: rgba(47, 125, 87, 0.34);
}

.wb-characteristic-field.dictionary-warn {
  border-color: rgba(181, 123, 25, 0.48);
  background: rgba(181, 123, 25, 0.06);
}

.wb-characteristic-field.dictionary-error {
  border-color: rgba(163, 68, 68, 0.5);
  background: rgba(163, 68, 68, 0.05);
}

.wb-characteristic-field.dictionary-unknown {
  border-color: rgba(98, 111, 103, 0.22);
}

.wb-characteristic-field span {
  display: grid;
  gap: 3px;
}

.wb-characteristic-field small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.wb-characteristic-field .dictionary-hint {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid;
  border-radius: 7px;
  font-weight: 800;
}

.rules-title {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
}

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

.metric-card {
  min-height: 112px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  font-size: 34px;
  line-height: 0.95;
  letter-spacing: 0;
}

.metric-card-wide {
  gap: 10px;
}

.progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7ece8;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 420px;
  gap: 14px;
  align-items: start;
}

.panel {
  min-height: 0;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-heading-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.category-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.category-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.category-button:hover,
.category-button.active {
  border-color: rgba(47, 125, 87, 0.48);
  background: rgba(47, 125, 87, 0.08);
}

.category-button.active {
  box-shadow: inset 3px 0 0 var(--green);
}

.category-name {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 800;
}

.category-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.search-wrap {
  width: min(320px, 42vw);
}

.search-wrap input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 125, 87, 0.12);
}

.coverage-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.coverage-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.coverage-item b {
  font-size: 16px;
}

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

.table-wrap {
  max-height: calc(100vh - 300px);
  min-height: 520px;
  overflow: auto;
}

.data-table,
.characteristics-table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8faf7;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 13px;
}

tr.subject-row {
  cursor: pointer;
}

tr.subject-row:hover,
tr.subject-row.selected {
  background: rgba(47, 125, 87, 0.08);
}

.subject-name {
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge-ok {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.08);
  color: var(--green-dark);
}

.badge-muted {
  border-color: rgba(98, 111, 103, 0.22);
  background: rgba(98, 111, 103, 0.06);
  color: var(--muted);
}

.badge-warn {
  border-color: rgba(181, 123, 25, 0.3);
  background: rgba(181, 123, 25, 0.1);
  color: var(--yellow);
}

.badge-error {
  border-color: rgba(163, 68, 68, 0.3);
  background: rgba(163, 68, 68, 0.08);
  color: var(--red);
}

.details-body {
  padding: 16px;
}

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

.detail-stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-stat span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.detail-stat strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.1;
}

.characteristics-wrap {
  max-height: calc(100vh - 480px);
  min-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.characteristics-table th,
.characteristics-table td {
  padding: 9px 10px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

.empty-state.compact {
  min-height: 96px;
  padding: 12px;
}

.loading-screen {
  min-height: 380px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
}

.error-box {
  padding: 16px;
  border: 1px solid rgba(163, 68, 68, 0.3);
  border-radius: 8px;
  background: rgba(163, 68, 68, 0.08);
  color: var(--red);
}

.success-box {
  padding: 16px;
  border: 1px solid rgba(45, 132, 92, 0.28);
  border-radius: 8px;
  background: rgba(45, 132, 92, 0.08);
  color: var(--green);
}

.success-box a {
  margin-left: 10px;
  color: var(--green);
  font-weight: 800;
}

.help-panel {
  margin-bottom: 18px;
}

.help-guide {
  padding: 16px;
}

.help-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.help-nav {
  position: sticky;
  top: 16px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.help-nav strong {
  margin-bottom: 4px;
  font-size: 13px;
}

.help-nav a {
  min-height: 32px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.help-nav a:hover {
  border-color: rgba(47, 125, 87, 0.32);
  background: rgba(47, 125, 87, 0.07);
  color: var(--green-dark);
}

.help-content {
  display: grid;
  gap: 14px;
}

.help-overview,
.help-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.help-overview {
  display: grid;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
}

.help-overview h3,
.help-section h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.help-workflow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0;
  padding-left: 20px;
}

.help-workflow li {
  padding-left: 2px;
  line-height: 1.35;
}

.help-section {
  scroll-margin-top: 16px;
  overflow: hidden;
}

.help-section-heading {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.help-section-heading p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.help-mock {
  margin: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f8faf8;
}

.help-mock-top {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #eef4f0;
}

.help-mock-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(47, 125, 87, 0.28);
}

.help-mock-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px;
}

.help-mock-item {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.help-mock-item.primary {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.help-mock-item.secondary {
  border-color: rgba(47, 125, 87, 0.28);
  background: rgba(47, 125, 87, 0.08);
  color: var(--green-dark);
}

.help-mock-item.status {
  border-color: rgba(47, 125, 87, 0.32);
  background: rgba(47, 125, 87, 0.1);
  color: var(--green-dark);
}

.help-mock-item.danger {
  border-color: rgba(163, 68, 68, 0.3);
  background: rgba(163, 68, 68, 0.08);
  color: var(--red);
}

.help-table-wrap {
  margin: 0 16px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.help-table th,
.help-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  line-height: 1.4;
}

.help-table th {
  background: #f7faf8;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.help-table tr:last-child td {
  border-bottom: 0;
}

.help-tips {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.help-tips p {
  padding: 10px 12px;
  border: 1px solid rgba(181, 123, 25, 0.22);
  border-radius: 8px;
  background: rgba(181, 123, 25, 0.08);
  color: #5c4a22;
  line-height: 1.4;
}

@media (max-width: 1180px) {
  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .draft-toolbar,
  .draft-workbench {
    grid-template-columns: 1fr;
  }

  .draft-editor-pane {
    position: static;
  }

  .workbench-panel .draft-editor {
    height: auto;
    min-height: 0;
  }

  .workbench-panel .drafts-table-wrap {
    max-height: 520px;
  }

  .workspace-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

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

  .google-info-wide {
    grid-column: 1 / -1;
  }

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

  .details-panel {
    grid-column: 1 / -1;
  }

  .characteristics-wrap {
    max-height: 420px;
  }

  .help-layout,
  .help-overview,
  .infographics-layout {
    grid-template-columns: 1fr;
  }

  .help-nav {
    position: static;
  }
}

@media (max-width: 820px) {
  .app-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 12px;
  }

  .view-tabs {
    overflow-x: auto;
  }

  .view-tab {
    flex: 0 0 auto;
  }

  .topbar,
  .panel-heading-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .summary-grid,
  .workspace-grid,
  .google-grid,
  .plan-meta-grid,
  .drafts-grid,
  .drafts-body,
  .workbench-panel .drafts-grid,
  .workbench-panel .drafts-body,
  .coverage-strip,
  .help-workflow {
    grid-template-columns: 1fr;
  }

  .draft-workbench,
  .draft-toolbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .bulk-actions {
    grid-template-columns: 1fr;
  }

  .infographics-bulk {
    grid-template-columns: 1fr;
  }

  .pricing-panel-heading {
    flex-direction: column;
  }

  .pricing-panel-heading > strong {
    width: 100%;
    text-align: center;
  }

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

  .search-wrap {
    width: 100%;
  }

  .table-wrap {
    min-height: 420px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    display: none;
  }
}
