@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Source+Serif+4:wght@500;600;700&display=swap");

:root {
  --bg: #f6f5f1;
  --bg-accent: #eef1f5;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5f6b7a;
  --border: #d9dde3;
  --accent: #1f6feb;
  --accent-dark: #174ea6;
  --success: #1a7f37;
  --warning: #b54708;
  --radius: 14px;
  --shadow: 0 12px 30px rgba(17, 24, 39, 0.08);
  --gap: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Source Serif 4", sans-serif;
  color: var(--ink);
  background: linear-gradient(120deg, var(--bg), var(--bg-accent));
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header,
.site-footer {
  padding: 20px 32px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}

.site-footer {
  border-top: 1px solid var(--border);
  border-bottom: none;
  color: var(--muted);
}

.site-title {
  font-family: "Source Serif 4", serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.site-main {
  flex: 1;
  padding: 24px 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.page--split {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
}

.search-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

#search {
  width: 280px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
}

.help {
  color: var(--muted);
  font-size: 13px;
}

.panes {
  display: grid;
  grid-template-columns: minmax(300px, 0.35fr) minmax(360px, 0.65fr);
  gap: 20px;
  min-height: 0;
}

.panes.is-collapsed {
  grid-template-columns: 1fr;
}

.panes.is-collapsed .left-pane {
  display: none;
}

.left-pane,
.right-pane {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.left-pane:hover,
.right-pane:hover {
  scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.left-pane::-webkit-scrollbar,
.right-pane::-webkit-scrollbar {
  width: 5px;
}

.left-pane::-webkit-scrollbar-thumb,
.right-pane::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}

.left-pane:hover::-webkit-scrollbar-thumb,
.right-pane:hover::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

.table-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#table-container {
  max-width: 100%;
  overflow-x: auto;
}

.table-count {
  color: var(--muted);
  font-size: 14px;
}

#products-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#products-table th,
#products-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#products-table th:nth-child(2),
#products-table td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
}

#products-table th {
  color: var(--muted);
  font-weight: 600;
}

.sortable {
  padding: 0;
}

.sort-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  padding: 10px 12px;
  cursor: pointer;
}

.sort-btn:hover {
  color: var(--ink);
}

.sort-indicator {
  margin-left: 6px;
  font-size: 11px;
  color: var(--muted);
}

.table-row {
  cursor: pointer;
  transition: background 0.2s ease;
}

.table-row:hover {
  background: #f3f5f9;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 18px 0;
}

.keyword-table-wrapper {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcff;
  overflow: visible;
}

.keyword-table-scroll {
  max-height: 260px;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 12px;
}

.keyword-filters-inline {
  margin: 0;
}

.kw-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.keyword-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.keyword-label {
  display: inline-flex;
  align-items: center;
}

.kw-filter-panel {
  position: relative;
}

.kw-filter-panel summary {
  list-style: none;
}

.kw-filter-panel summary::-webkit-details-marker {
  display: none;
}

.kw-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  background: transparent;
  border: none;
  color: var(--muted);
}

.kw-filter-panel[open] .kw-filter-btn {
  color: var(--accent-dark);
  border-color: rgba(31, 111, 235, 0.35);
  background: rgba(31, 111, 235, 0.08);
}

.kw-filter-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(31, 111, 235, 0.12);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 600;
}

.kw-filter-popover {
  position: absolute;
  bottom: 32px;
  right: 0;
  z-index: 5;
  min-width: 260px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kw-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.kw-filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.kw-filter-range {
  display: grid;
  grid-template-columns: minmax(60px, 1fr) minmax(60px, 1fr);
  gap: 6px;
}

.kw-filter-range input {
  padding: 6px 8px;
  font-size: 12px;
}

.kw-filter-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#current-description {
  height: 260px;
  resize: none;
  width: 100%;
}

.keyword-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 700px;
  table-layout: fixed;
}

.keyword-table th,
.keyword-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.keyword-table th:nth-child(2),
.keyword-table td:nth-child(2) {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.keyword-table th:first-child,
.keyword-table td:first-child {
  padding-right: 4px;
  width: 28px;
}

.keyword-selected-count {
  font-size: 12px;
  color: var(--muted);
}


.keyword-table th {
  background: #f2f5fa;
  color: var(--muted);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#page-info {
  color: var(--muted);
  font-size: 13px;
}

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

.ai-section {
  margin-top: 10px;
}

.ai-send-actions {
  margin-top: 12px;
}

.ai-result-section {
  margin-top: 16px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header-top #product-title {
  flex: 1 1 auto;
}

.pre-ai-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel.is-pre-ai-collapsed .pre-ai-sections {
  display: none;
}

.tabs {
  display: flex;
  gap: 2px;
  padding: 0 4px;
}

.tab-btn {
  padding: 9px 20px;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  margin-bottom: -1px;
  position: relative;
}

.tab-btn:hover {
  color: var(--ink);
  background: var(--bg-accent);
}

.tab-btn.active {
  color: var(--ink);
  background: var(--bg-accent);
  border-color: var(--border);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -1px;
  right: -1px;
  height: 2px;
  background: var(--bg-accent);
}

.tab-content {
  position: relative;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

#product-title {
  font-family: "Source Serif 4", serif;
  font-size: 20px;
  font-weight: 600;
}

.panel-meta {
  color: var(--muted);
  font-size: 13px;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-section label {
  font-size: 14px;
  font-weight: 600;
  color: #3f4b5a;
}

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

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

.prompt-actions {
  display: flex;
  justify-content: flex-end;
}

.prompt-actions-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  width: 100%;
}

#prompt-text,
#ai-result {
  height: 450px;
}

#generate {
  width: 100%;
}

.ai-settings-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.ai-result-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-result-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #475467;
}

.ai-cost {
  font-weight: 600;
}

.ai-tech-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
}

.ai-tech-toggle:hover {
  color: var(--accent-dark);
}

.ai-tech-toggle:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.ai-tech-details {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #f8f9fb;
  margin-bottom: 8px;
}

.select-compact {
  max-width: 220px;
}

.prompt-length {
  font-size: 13px;
  font-weight: 600;
  color: #475467;
}

.prompt-length-under {
  align-self: flex-start;
  margin-left: 8px;
  margin-top: 4px;
}

textarea,
select,
input[type="text"] {
  font-family: "Manrope", sans-serif;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
  background: #fbfcff;
  resize: vertical;
}

textarea[readonly],
textarea:disabled,
select:disabled {
  background: #f2f4f8;
  color: var(--muted);
}

.btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(31, 111, 235, 0.25);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-secondary {
  background: #e8edf6;
  color: #1f2a44;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-extra {
  color: var(--muted);
  font-size: 13px;
}

.loading {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #c9d4e5;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.hidden {
  display: none;
}

.hint {
  font-size: 14px;
  color: var(--muted);
  background: #f7f8fb;
  border: 1px dashed var(--border);
  padding: 12px 14px;
  border-radius: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-top {
  z-index: 60;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-json-card {
  width: min(760px, 100%);
}

.ai-desc-full-card {
  width: min(960px, 96vw);
  max-height: 90vh;
}

.ai-desc-full-card .modal-body {
  max-height: 70vh;
  overflow: auto;
}

.ai-desc-full-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.ai-desc-full-content {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.prompt-json-content {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f7f9fc;
  font-size: 13px;
  line-height: 1.5;
  max-height: 60vh;
  overflow: auto;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.prompt-json-content details {
  margin: 0;
}

.prompt-json-content summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  line-height: 1.35;
}

.prompt-json-content summary::-webkit-details-marker {
  display: none;
}

.prompt-json-content summary::before {
  content: "▸";
  color: var(--muted);
  display: inline-block;
  transition: transform 0.15s ease;
}

.prompt-json-content details[open] > summary::before {
  transform: rotate(90deg);
}

.json-children {
  margin-left: 12px;
  padding-left: 8px;
  border-left: 1px dashed #d6dbe4;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.json-node {
  margin: 0;
  line-height: 1.35;
}

.json-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.json-count {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e8edf6;
  color: #1f2a44;
}

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

.prompt-json-content .json-key {
  color: #1849b5;
  font-weight: 600;
}

.prompt-json-content .json-string {
  color: #0f766e;
}

.prompt-json-content .json-number {
  color: #a16207;
}

.prompt-json-content .json-boolean {
  color: #b42318;
}

.prompt-json-content .json-null {
  color: #6b7280;
}

.ai-settings-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f7f9fc;
  border-radius: 8px;
  font-size: 13px;
}

.ai-settings-key {
  color: var(--muted);
  font-weight: 500;
  flex-shrink: 0;
}

.ai-settings-input {
  font-weight: 600;
  color: var(--ink);
  font-family: "Manrope", monospace;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 80px;
  text-align: right;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-settings-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

.ai-settings-input.is-custom {
  border-color: var(--accent);
  background: #f0f6ff;
}

.modal-header h2 {
  margin: 0;
  font-family: "Source Serif 4", serif;
  font-size: 20px;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.checkbox-field {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  white-space: nowrap;
}

.ai-desc-trigger {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.ai-desc-trigger:hover {
  color: var(--accent-dark);
}

.ai-descriptions-card {
  width: min(1900px, 98vw);
  max-width: 1900px;
  padding: 18px;
  gap: 14px;
}

.ai-descriptions-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-descriptions-card .modal-body {
  max-height: 85vh;
  overflow: auto;
}

.ai-descriptions-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ai-descriptions-title {
  font-weight: 600;
  font-size: 16px;
}

.ai-descriptions-meta {
  color: var(--muted);
  font-size: 13px;
}

.ai-descriptions-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.ai-descriptions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1300px;
  table-layout: fixed;
}

.ai-descriptions-table th,
.ai-descriptions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  font-size: 13px;
}

.ai-descriptions-table tr.is-used {
  background: #f4f7fb;
}

.ai-desc-col-select {
  width: 66px;
  text-align: center;
}

.ai-desc-col-used {
  width: 88px;
}

.ai-desc-col-version {
  width: 70px;
}

.ai-desc-col-date {
  width: 150px;
}

.ai-desc-col-author {
  width: 120px;
}

.ai-desc-col-model {
  width: 160px;
}

.ai-desc-col-title {
  width: 140px;
}

.ai-desc-col-queries {
  min-width: 280px;
}

.ai-desc-col-length {
  width: 80px;
  text-align: right;
}

.ai-desc-col-text {
  width: auto;
}

.ai-desc-col-examples {
  width: 120px;
}

.ai-desc-col-actions {
  width: 80px;
  text-align: center;
}

.ai-desc-delete-link {
  color: #dc2626;
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
}

.ai-desc-delete-link:hover {
  text-decoration: underline;
}

.ai-examples-toggle,
.ai-desc-queries-toggle,
.ai-desc-queries-collapse {
  margin-top: 4px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ai-examples-toggle:hover,
.ai-desc-queries-toggle:hover,
.ai-desc-queries-collapse:hover {
  color: var(--accent-dark);
}

.ai-examples-modal-card {
  width: min(900px, 94vw);
  max-width: 900px;
  padding: 18px;
  gap: 14px;
}

.ai-examples-modal-card .modal-body {
  max-height: 70vh;
  overflow: auto;
}

.ai-examples-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ai-examples-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}

.ai-examples-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.ai-examples-item-num {
  font-weight: 600;
  font-size: 13px;
  color: var(--muted);
}

.ai-examples-item-url {
  font-size: 12px;
  color: var(--accent);
  word-break: break-all;
}

.ai-examples-item-url:hover {
  color: var(--accent-dark);
}

.ai-examples-item-text {
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow: auto;
}

.ai-desc-muted {
  color: var(--muted);
  font-size: 12px;
}

.ai-desc-queries-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-desc-query {
  font-size: 12px;
  color: var(--ink);
  word-break: break-word;
}

.ai-desc-preview {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-desc-toggle {
  margin-top: 6px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.ai-desc-toggle:hover {
  color: var(--accent-dark);
}

.ai-desc-full {
  margin-top: 8px;
}

.ai-desc-full pre {
  white-space: pre-wrap;
  margin: 8px 0 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ai-desc-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.ai-desc-page-info {
  color: var(--muted);
  font-size: 13px;
}

.prompt-json-actions {
  flex-wrap: wrap;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  .panes {
    grid-template-columns: 1fr;
  }

  .site-main {
    overflow: auto;
  }

  .page--split {
    grid-template-rows: auto;
    min-height: auto;
  }

  .left-pane,
  .right-pane {
    overflow-y: visible;
  }

  #search {
    width: 100%;
  }

  .kw-filter-grid {
    grid-template-columns: 1fr;
  }

}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.login-title {
  font-family: "Source Serif 4", serif;
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 28px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.login-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.login-field input,
.login-field select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 15px;
}

.login-btn {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

.login-btn:hover {
  background: var(--accent-dark);
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--warning);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.flash-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: var(--success);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 14px;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
}

.header-user a {
  color: var(--accent);
  text-decoration: none;
}

.header-user a:hover {
  text-decoration: underline;
}

.header-user form {
  display: inline;
}

.header-user button {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
}

.header-user button:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.profile-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.profile-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

.profile-label {
  color: var(--muted);
  font-size: 13px;
  width: 200px;
}

.profile-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.profile-section {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.section-title {
  font-family: "Source Serif 4", serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 20px;
}

.section-subtitle {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px;
}

.users-card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow-x: auto;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.users-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.user-inactive td {
  opacity: 0.5;
}

.user-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.input-sm {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.btn-sm {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  cursor: pointer;
  font-size: 13px;
}

.btn-sm:hover {
  background: var(--bg-accent);
}

.btn-danger {
  color: #dc2626;
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
}

.example-section {
  padding-top: 8px;
}

.example-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.example-url-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--ink);
}

.example-url-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(31, 111, 235, 0.15);
}

.example-error {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--warning);
  font-size: 0.82rem;
}

.example-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.example-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg-accent);
}

.example-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.example-item-num {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.example-item-link {
  flex: 1;
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.example-item-link:hover {
  text-decoration: underline;
}

.example-delete-btn {
  padding: 2px 6px;
  font-size: 0.85rem;
  line-height: 1;
}

.example-item-desc {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  background: var(--panel);
  color: var(--ink);
}

.example-item-length {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.example-counter {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.example-limit {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
}

.new-title-field {
  margin-bottom: 8px;
}

.new-title-field #new-title-length {
  margin-top: 2px;
}

.new-title-field label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.9em;
}

.new-title-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-title-controls input[type="text"] {
  flex: 0 1 560px;
  padding: 5px 8px;
  border: 1px solid var(--border-color, #ccc);
  border-radius: 4px;
  font-size: 0.9em;
}

.new-title-controls input[type="text"][readonly] {
  background-color: var(--bg-readonly, #f5f5f5);
  cursor: default;
}

.new-title-controls input.is-modified {
  font-style: italic;
  border-color: var(--accent-color, #4a90d9);
}

.new-title-controls .btn {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 0.85em;
}

.ai-new-title-modified {
  font-style: italic;
  color: var(--accent-color, #4a90d9);
}
