/* CopyFlow.ai — Hi-Tech Neomorphism, B/W palette */

:root {
  --bg-page: #EBEBEB;
  --bg-card: #FFFFFF;
  --bg-dark: #1C1C1E;
  --text: #111111;
  --text-muted: #888888;
  --text-dim: #AAAAAA;
  --accent: #000000;
  --accent-hover: #333333;
  --inactive: #666666;
  --neo-shadow: 6px 6px 16px rgba(0,0,0,0.08), -4px -4px 12px rgba(255,255,255,0.9);
  --neo-shadow-inset: inset 3px 3px 8px rgba(0,0,0,0.08), inset -2px -2px 6px rgba(255,255,255,0.9);
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --bottom-nav-height: 80px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-page);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow-x: hidden;
  padding-bottom: var(--bottom-nav-height);
}

.app {
  width: 100%;
  min-width: 0;
  max-width: 1100px;
  padding: 16px;
  overflow-x: hidden;
}

/* --- Header --- */
.header {
  margin: 0 -16px 20px -16px;
  padding: 20px 24px;
  background: var(--bg-dark);
  border-radius: 0 0 24px 24px;
  min-width: 0;
  overflow-wrap: break-word;
}

.header__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header__row > div:first-child {
  flex: 1;
  min-width: 0;
}

.header__row > .lang-switcher-pill {
  flex: 0 0 auto;
  margin-left: auto;
}

.header__title {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.header__sub {
  margin: 0;
  font-size: 13px;
  color: #AAAAAA;
}

/* Lang switcher — pill */
.lang-switcher-pill {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lang-switcher {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--inactive);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-switcher:hover {
  color: #FFFFFF;
}

.lang-switcher.active {
  background: rgba(0,0,0,0.4);
  color: #FFFFFF;
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.3), inset -1px -1px 4px rgba(255,255,255,0.05);
}

/* --- Main layout --- */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.main.main--chat {
  grid-template-columns: 1fr;
  align-items: stretch;
  min-height: calc(100vh - 180px);
}

.main.main--chat .panel--right {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main.main--chat .panel--right .chat-panel {
  flex: 1;
  min-height: 0;
}

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

/* --- Panels — neomorphism --- */
.panel {
  border-radius: var(--radius);
  padding: 24px;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  border: none;
  min-width: 0;
  overflow-wrap: break-word;
}

.panel--left,
.panel--right {
  min-width: 0;
}

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

.panel-section {
  min-width: 0;
}

.panel-section + .panel-section {
  padding-top: 20px;
  margin-top: 20px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

/* --- Section labels --- */
.section-title {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* --- Mode tabs — square neomorphism cards --- */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.mode-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  color: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  aspect-ratio: 1;
  min-width: 0;
}

.mode-tab:hover {
  box-shadow: 4px 4px 12px rgba(0,0,0,0.1), -2px -2px 8px rgba(255,255,255,0.95);
}

.mode-tab:active:not(.active) {
  box-shadow: var(--neo-shadow-inset);
}

.mode-tab.active {
  background: var(--bg-page);
  color: var(--text);
  box-shadow: var(--neo-shadow-inset);
}

.mode-tab__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--text);
}

.mode-tab.active .mode-tab__icon {
  color: var(--text);
}

.mode-tab__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  min-width: 0;
  text-align: center;
}

@media (max-width: 600px) {
  .mode-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .mode-tab {
    padding: 10px 4px;
    font-size: 10px;
  }
  .mode-tab__icon {
    width: 20px;
    height: 20px;
  }
}

/* --- Presets / scenario cards — neomorphism --- */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.preset-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
  position: relative;
}

.preset-card:hover {
  box-shadow: 4px 4px 12px rgba(0,0,0,0.1), -2px -2px 8px rgba(255,255,255,0.95);
}

.preset-card:active {
  box-shadow: var(--neo-shadow-inset);
}

.preset-card__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
}

.preset-card__sub {
  font-size: 12px;
  color: var(--text-muted);
}

.preset-card::after {
  content: "→";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--text-muted);
}

/* --- Profile --- */
.profile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-toggle:hover {
  color: var(--text);
}

.profile-toggle__icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.profile-toggle[aria-expanded="true"] .profile-toggle__icon {
  transform: rotate(180deg);
}

.profile-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.profile-content.is-open {
  max-height: 300px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-top: 12px;
}

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

/* --- Fields --- */
.field {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.input-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Inputs — inset neomorphism */
input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-radius: var(--radius-sm);
  border: none;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
  outline: none;
  transition: all 0.2s ease;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.1), inset -1px -1px 4px rgba(255,255,255,0.9);
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: var(--font-mono);
  font-size: 13px;
  min-width: 0;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* --- Input bookmark --- */
.input-bookmark-btn {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.input-bookmark-btn:hover {
  color: var(--text);
  box-shadow: 4px 4px 12px rgba(0,0,0,0.1), -2px -2px 8px rgba(255,255,255,0.95);
}

/* --- Run button — black primary --- */
.run-btn {
  position: relative;
  margin-top: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
}

.run-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.run-btn:active:not(:disabled) {
  box-shadow: inset 2px 2px 8px rgba(0,0,0,0.4);
  transform: scale(0.98);
}

.run-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.run-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.run-btn:disabled .run-btn__spinner {
  display: block;
}

.run-btn:disabled .run-btn__text {
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

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

/* --- Chat panel --- */
.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  height: 100%;
}

.chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.chat-panel__title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.chat-clear-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-clear-btn:hover {
  color: var(--text);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 0;
  min-height: 120px;
}

.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  border: none;
}

.chat-message--user {
  align-self: flex-end;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  color: var(--text);
}

.chat-message--assistant {
  align-self: flex-start;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
  color: var(--text);
}

.chat-message--typing {
  align-self: flex-start;
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.chat-typing-dots span {
  animation: chat-typing-bounce 1.4s ease-in-out infinite;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.chat-input-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
  padding-top: 16px;
  margin-top: 12px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

.chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  transition: all 0.2s ease;
}

.chat-input:focus {
  outline: none;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-send-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 4px 4px 10px rgba(0,0,0,0.12);
}

.chat-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

.chat-send-btn:active:not(:disabled) {
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.4);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Channel tone, autopost --- */
.channel-tone-hint,
.autopost-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.channel-tone-result {
  margin-top: 16px;
  padding-top: 16px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

.channel-tone-result__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.channel-tone-display {
  margin: 0 0 16px;
  padding: 14px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  box-shadow: var(--neo-shadow-inset);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

/* --- Scenarios --- */
.scenarios-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.scenario-card {
  padding: 14px 16px;
  border-radius: 16px;
  border: none;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  position: relative;
}

.scenario-card__info {
  margin-bottom: 8px;
}

.scenario-card__name {
  font-weight: 700;
  font-size: 16px;
  display: block;
  color: var(--text);
}

.scenario-card__type {
  font-size: 12px;
  color: var(--text-muted);
}

.scenario-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.scenario-card__btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.scenario-card__btn:hover {
  color: var(--accent);
}

.scenario-card__btn--run {
  background: var(--accent);
  color: #FFFFFF;
}

.scenario-card__btn--run:hover {
  background: var(--accent-hover);
}

.scenarios-empty {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
}

.scenario-result-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
}

.scenario-result__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.scenario-result__text {
  margin: 0 0 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
  color: var(--text);
}

.scenario-result__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scenario-result__actions .run-btn {
  width: auto;
  min-width: 0;
  margin-top: 0;
  flex: 0 0 auto;
}

/* --- Autopost --- */
.autopost-refresh-btn {
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.autopost-refresh-btn:hover:not(:disabled) {
  color: var(--text);
}

.autopost-refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.autopost-time-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.autopost-time-row .select,
.autopost-time-row .input {
  flex: 1;
  min-width: 0;
}

.autopost-scheduled-panel {
  margin-bottom: 16px;
}

.autopost-scheduled__title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.autopost-scheduled-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.autopost-scheduled-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
}

.autopost-scheduled-item__text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.autopost-scheduled-item__time {
  font-size: 11px;
  color: var(--text-muted);
}

.autopost-scheduled-item__edit {
  padding: 6px 10px;
  margin-right: 6px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.autopost-scheduled-item__edit:hover {
  color: var(--text);
}

.autopost-scheduled-item__cancel {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.autopost-scheduled-item__cancel:hover {
  color: var(--text);
}

.autopost-scheduled-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Result panel --- */
.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-btn,
.diff-btn,
.bookmark-btn,
.post-channel-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover,
.diff-btn:hover,
.bookmark-btn:hover,
.post-channel-btn:hover {
  color: var(--text);
}

/* --- Modals --- */
.post-channel-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.post-channel-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.post-channel-modal__content {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 8px 8px 24px rgba(0,0,0,0.12), -4px -4px 16px rgba(255,255,255,0.9);
  border: none;
}

.post-channel-modal__content--wide {
  max-width: 420px;
}

.post-channel-modal__title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.post-channel-modal__actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.post-channel-action-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-channel-action-btn:hover {
  color: var(--accent);
}

.post-channel-sched-section {
  margin-top: 16px;
  padding-top: 16px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

.post-channel-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.post-channel-modal-close:hover {
  color: var(--text);
}

/* --- Diff view --- */
.diff-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .diff-view {
    grid-template-columns: 1fr;
  }
}

.diff-block {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
}

.diff-block__title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.diff-block__content {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: var(--text);
}

.diff-added {
  background: rgba(0,0,0,0.04);
}

.diff-removed {
  background: rgba(0,0,0,0.06);
}

/* --- History & Bookmarks --- */
.history-bookmarks {
  margin-top: 20px;
  padding-top: 20px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

.history-bookmarks-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-bookmarks-toggle:hover {
  color: var(--text);
}

.history-bookmarks-toggle__icon {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.history-bookmarks-toggle[aria-expanded="true"] .history-bookmarks-toggle__icon {
  transform: rotate(180deg);
}

.history-bookmarks-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.history-bookmarks-content.is-open {
  max-height: 400px;
}

.history-section,
.bookmarks-section {
  margin-top: 14px;
}

.history-section__title,
.bookmarks-section__title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.restore-draft-btn {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.restore-draft-btn:hover {
  color: var(--text);
}

.history-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.history-clear-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-clear-btn:hover {
  color: var(--text);
}

.history-list,
.bookmarks-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item,
.bookmark-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--bg-card);
  box-shadow: var(--neo-shadow);
  cursor: pointer;
  transition: all 0.2s ease;
}

.history-item:hover,
.bookmark-item:hover {
  box-shadow: 4px 4px 12px rgba(0,0,0,0.1), -2px -2px 8px rgba(255,255,255,0.95);
}

.history-item__text,
.bookmark-item__text {
  flex: 1;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-item__remove {
  flex-shrink: 0;
  padding: 6px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  color: var(--text-muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bookmark-item__remove:hover {
  color: var(--text);
}

.history-empty,
.bookmarks-empty {
  padding: 12px 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* --- Output --- */
.output-placeholder {
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
}

.output-placeholder__hint {
  margin-top: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.output {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.55;
  max-height: 480px;
  overflow: auto;
  padding: 14px 0 0;
  color: var(--text);
  margin: 0;
  max-width: 100%;
}

/* --- Variants --- */
.variants-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  min-height: 28px;
}

.variant-pill {
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--bg-page);
  box-shadow: var(--neo-shadow);
  font-family: inherit;
  transition: all 0.2s ease;
}

.variant-pill:hover {
  color: var(--text);
}

.variant-pill.active {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.15);
}

/* --- Check result --- */
.check-result {
  max-height: 520px;
  overflow-y: auto;
  padding-bottom: 12px;
}

.check-result h3 {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.check-issues {
  margin-bottom: 18px;
}

.check-issues ul {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

.check-issues li {
  margin-bottom: 6px;
}

.check-structure {
  padding-top: 16px;
  margin-top: 16px;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.04);
}

.structure-blocks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.structure-block {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--bg-page);
  box-shadow: var(--neo-shadow-inset);
}

.structure-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.structure-block-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.structure-block-badge {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.structure-block-badge.present {
  background: rgba(0,0,0,0.08);
  color: var(--text);
}

.structure-block-badge.absent {
  background: rgba(0,0,0,0.12);
  color: var(--text-muted);
}

.structure-block-score {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.structure-block-comment {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

.structure-block-tips {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.structure-block-tips li {
  margin-bottom: 3px;
}

/* --- Bottom navigation --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-dark);
  border-radius: 24px 24px 0 0;
  padding: 12px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
}

.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  padding: 8px 16px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: #999999;
  cursor: pointer;
  transition: all 0.2s ease;
}

.bottom-nav__item:hover {
  color: #FFFFFF;
  background: rgba(255,255,255,0.08);
}

.bottom-nav__item.active {
  color: #FFFFFF;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.2);
}

.bottom-nav__icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.bottom-nav__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* --- Access block overlay (no subscription / not from Telegram) --- */
.access-block {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
}
.access-block__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px;
}
.access-block__text {
  font-size: 15px;
  color: rgba(255,255,255,0.85);
  margin: 0 0 24px;
  max-width: 320px;
}
.access-block__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #2481cc;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
}
.access-block__btn:hover {
  background: #1a6bb3;
}
