:root {
  --voice-bg: #f7f9fd;
  --voice-panel: rgba(255, 255, 255, 0.94);
  --voice-border: #c6d3e4;
  --voice-shadow: 0 20px 48px rgba(17, 31, 58, 0.12);
  --voice-text: #16253d;
  --voice-muted: #44566f;
  --voice-link: #0a58ca;
  --voice-button-bg: #ffffff;
  --voice-button-hover: #f2f6fb;
  --voice-button-text: #000000;
  --voice-active: #dbeafe;
  --voice-staged: #fff2c4;
  --voice-approved: #dff6e8;
  --voice-danger: #9f1d1d;
}

:root[data-theme="dark"] {
  --voice-bg: #13253d;
  --voice-panel: rgba(17, 32, 54, 0.94);
  --voice-border: #5579a8;
  --voice-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  --voice-text: #e9f1ff;
  --voice-muted: #c0d1eb;
  --voice-link: #a9caff;
  --voice-button-bg: #23456f;
  --voice-button-hover: #2f5a8d;
  --voice-button-text: #a9caff;
  --voice-active: #244d80;
  --voice-staged: #5b4a1d;
  --voice-approved: #1d5135;
  --voice-danger: #ffb4b4;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--voice-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--voice-bg);
  color: var(--voice-text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.voice-page {
  width: min(100% - 32px, 1240px);
  margin: 0 auto;
  padding: 24px 0 48px;
}

.voice-header {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}

.voice-nav,
.voice-toolbar,
.voice-tabs,
.voice-submit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.voice-nav {
  justify-content: center;
}

.voice-nav-link,
.voice-tool-button,
.voice-primary-button,
.voice-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--voice-border);
  border-radius: 10px;
  background: var(--voice-button-bg);
  color: var(--voice-button-text);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--voice-shadow);
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.voice-nav-link:hover,
.voice-nav-link:focus-visible,
.voice-tool-button:hover,
.voice-tool-button:focus-visible,
.voice-primary-button:hover,
.voice-primary-button:focus-visible,
.voice-tab:hover,
.voice-tab:focus-visible {
  background: var(--voice-button-hover);
  border-color: var(--voice-button-hover);
  transform: translateY(-1px);
  outline: none;
}

.voice-tab[aria-selected="true"] {
  background: var(--voice-active);
  border-color: var(--voice-link);
}

.voice-hero {
  margin: 0 0 22px;
  text-align: center;
}

.voice-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
}

.voice-toolbar {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

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

.voice-table-wrap,
.voice-editor,
.voice-submit-panel {
  border: 1px solid var(--voice-border);
  background: var(--voice-panel);
  box-shadow: var(--voice-shadow);
}

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

.voice-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.voice-table th,
.voice-table td {
  border: 1px solid var(--voice-border);
  vertical-align: top;
}

.voice-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--voice-panel);
  color: var(--voice-muted);
  font-size: 0.82rem;
}

.voice-row-head {
  position: sticky;
  left: 0;
  width: 54px;
  z-index: 3;
  background: var(--voice-panel);
  color: var(--voice-muted);
  font-size: 0.82rem;
}

.voice-cell {
  height: 54px;
  min-width: 150px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--voice-text);
  cursor: pointer;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.voice-table tbody tr:first-child .voice-cell {
  font-weight: 700;
}

:root[data-theme="dark"] .voice-cell {
  background: rgba(0, 0, 0, 0.12);
}

.voice-cell.is-selected {
  box-shadow: inset 0 0 0 3px var(--voice-link);
}

.voice-cell.is-staged {
  background: var(--voice-staged);
}

.voice-cell.is-approved {
  background: var(--voice-approved);
}

.voice-cell a {
  color: var(--voice-link);
  font-weight: 700;
}

.voice-cell-text {
  margin-bottom: 6px;
}

.voice-cell-links {
  display: grid;
  gap: 3px;
}

.voice-empty {
  color: var(--voice-muted);
}

.voice-editor {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.voice-editor h2,
.voice-submit-panel h2 {
  margin: 0;
}

.voice-selected-cell,
.voice-status {
  margin: 0;
  color: var(--voice-muted);
  line-height: 1.45;
}

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

.voice-editor label {
  display: grid;
  gap: 5px;
  color: var(--voice-muted);
  font-weight: 700;
}

.voice-editor input,
.voice-editor textarea {
  width: 100%;
  border: 1px solid var(--voice-border);
  background: var(--voice-bg);
  color: var(--voice-text);
  padding: 9px 10px;
  resize: vertical;
}

.voice-link-editor {
  display: grid;
  gap: 10px;
}

.voice-link-editor-head {
  display: grid;
  gap: 8px;
}

.voice-link-editor-head h3 {
  margin: 0;
  color: var(--voice-muted);
  font-size: 1rem;
}

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

.voice-small-button,
.voice-remove-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--voice-border);
  border-radius: 8px;
  background: var(--voice-button-bg);
  color: var(--voice-button-text);
  font-weight: 700;
  cursor: pointer;
}

.voice-small-button:hover,
.voice-small-button:focus-visible,
.voice-remove-link:hover,
.voice-remove-link:focus-visible {
  background: var(--voice-button-hover);
  outline: none;
}

.voice-link-rows {
  display: grid;
  gap: 8px;
}

.voice-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--voice-border);
  background: rgba(255, 255, 255, 0.38);
}

:root[data-theme="dark"] .voice-link-row {
  background: rgba(0, 0, 0, 0.14);
}

.voice-link-row label {
  min-width: 0;
}

.voice-remove-link {
  color: var(--voice-danger);
}

.voice-submit-panel {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 18px;
}

.voice-pending-list {
  display: grid;
  gap: 8px;
}

.voice-pending-row {
  display: grid;
  grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--voice-border);
  background: rgba(255, 255, 255, 0.42);
}

:root[data-theme="dark"] .voice-pending-row {
  background: rgba(0, 0, 0, 0.14);
}

.voice-pending-row strong,
.voice-pending-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.voice-remove-change {
  min-height: 34px;
  color: var(--voice-danger);
}

.voice-submit-actions {
  align-items: center;
  justify-content: space-between;
}

.home-footer {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 0 34px;
}

.home-bottom-link {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  text-decoration: none;
}

.home-bottom-link svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: currentColor;
}

:root[data-theme="dark"] .home-bottom-link {
  color: #f3f7ff;
}

@media (max-width: 900px) {
  .voice-page {
    width: min(100% - 18px, 1240px);
    padding-top: 16px;
  }

  .voice-workspace,
  .voice-link-row,
  .voice-pending-row {
    grid-template-columns: 1fr;
  }

  .voice-toolbar {
    justify-content: center;
  }
}
