:root {
  font-family: "DM Sans", sans-serif;
  color: var(--text-primary);
  background: var(--page-background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color-scheme: light;
  --watermelon: #ed254e;
  --royal-gold: #f9dc5c;
  --tea-green: #c2eabd;
  --prussian-blue: #011936;
  --charcoal-blue: #465362;
  --page-background: #f8faf8;
  --surface: #fff;
  --surface-subtle: #f7f9f8;
  --text-primary: var(--prussian-blue);
  --text-secondary: var(--charcoal-blue);
  --text-muted: #7d8993;
  --line: #e2e8e4;
  --accent: var(--watermelon);
  --accent-soft: #fff0f2;
  --highlight: var(--royal-gold);
  --positive: var(--tea-green);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 2;
  display: flex;
  width: 250px;
  flex-direction: column;
  padding: 29px 17px 16px;
  color: #d6d6e3;
  background: var(--prussian-blue);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fff;
  background: var(--watermelon);
  border-radius: 11px;
  box-shadow: 0 5px 14px #ed254e44;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  font-family: "Manrope", sans-serif;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.8px;
}

.brand-name span {
  color: var(--royal-gold);
}

.sidebar-section {
  margin-top: 54px;
}

.sidebar-label {
  margin: 0 0 13px 11px;
  color: #84869c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
}

.nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  color: #d8d8e5;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav-item:hover {
  background: #ffffff0b;
}

.nav-item.active {
  color: #fff;
  background: #ffffff12;
}

.nav-icon {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--tea-green);
}

.nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-arrow {
  margin-left: auto;
  color: #a7a6bb;
  font-size: 14px;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-note {
  margin: 0 4px 19px;
  padding: 15px 13px;
  border: 1px solid #ffffff12;
  border-radius: 11px;
  background: linear-gradient(135deg, #ffffff08, #ffffff03);
}

.note-spark {
  color: #b29eff;
  font-size: 16px;
}

.sidebar-note p {
  margin: 8px 0 0;
  color: #c1c1d1;
  font-size: 13px;
  line-height: 1.6;
}

.profile {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 4px 1px;
  border-top: 1px solid #ffffff15;
}

.profile-avatar,
.avatar-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: linear-gradient(140deg, #f0ae9e, #d77f93);
  border: 0;
  border-radius: 50%;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
}

.profile-avatar {
  width: 31px;
  height: 31px;
  font-size: 12px;
}

.profile-copy {
  display: grid;
  gap: 3px;
}

.profile-name {
  color: #e4e4ed;
  font-size: 12px;
  font-weight: 600;
}

.profile-caption {
  color: #9293a8;
  font-size: 11px;
}

.profile-menu {
  margin-left: auto;
  color: #a3a4b5;
  font-size: 20px;
  letter-spacing: 1px;
}

.main-content {
  min-height: 100vh;
  margin-left: 250px;
}

.topbar {
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 56px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #a0a2b1;
  font-size: 13px;
}

.breadcrumb-divider {
  color: #c6c7d1;
}

.breadcrumb-current {
  color: #46495b;
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.theme-toggle {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--charcoal-blue);
  background: var(--surface-subtle);
}

.theme-toggle svg {
  width: 15px;
  height: 15px;
}

.sun-icon {
  display: none;
}

.theme-toggle:focus-visible,
button:focus-visible {
  outline: 2px solid var(--watermelon);
  outline-offset: 2px;
}

.local-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #797d90;
  font-size: 12px;
}

.local-indicator span,
.footer-version span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58c69a;
  box-shadow: 0 0 0 3px #58c69a1b;
}

.avatar-button {
  width: 32px;
  height: 32px;
  cursor: default;
  font-size: 11px;
}

.page-content {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: 56px 56px 36px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #8d91a2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--watermelon);
  transform: rotate(45deg);
}

.heading-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 11px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  color: var(--text-primary);
  font-family: "Manrope", sans-serif;
  font-size: clamp(28px, 3.2vw, 35px);
  font-weight: 800;
  letter-spacing: -1.35px;
}

.page-description {
  margin-bottom: 0;
  color: #888c9e;
  font-size: 14px;
  line-height: 1.6;
}

.heading-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  padding: 7px 10px;
  color: var(--prussian-blue);
  border: 1px solid #f0dfa0;
  border-radius: 20px;
  background: #fff8d8;
  font-size: 11px;
  font-weight: 600;
}

.heading-badge span {
  font-size: 12px;
}

.converter-card {
  margin-top: 36px;
  padding: 29px 30px 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 7px 22px #30345508;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}

.card-top h2 {
  margin-bottom: 4px;
  color: var(--text-primary);
  font-family: "Manrope", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.card-top p {
  margin-bottom: 0;
  color: #9699a8;
  font-size: 12px;
}

.direction-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-subtle);
}

.direction-button {
  display: inline-flex;
  min-height: 35px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 11px;
  color: #888c9e;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.direction-button svg {
  width: 15px;
  height: 15px;
}

.direction-button.selected {
  color: var(--prussian-blue);
  background: var(--surface);
  box-shadow: 0 1px 4px #25234215;
}

.editor-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.editor-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.editor-heading {
  display: flex;
  height: 46px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  border-bottom: 1px solid var(--line);
}

.editor-heading label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}

.format-pill {
  padding: 5px 7px;
  color: var(--prussian-blue);
  border-radius: 4px;
  background: #fff8d8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.output-format {
  color: var(--text-secondary);
  background: var(--surface-subtle);
}

.editor-panel textarea {
  display: block;
  width: 100%;
  height: 205px;
  resize: vertical;
  padding: 15px;
  color: var(--text-primary);
  border: 0;
  outline: none;
  background: transparent;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  line-height: 1.65;
}

.editor-panel textarea::placeholder {
  color: var(--text-muted);
}

.editor-panel textarea:focus-visible {
  box-shadow: inset 0 0 0 2px #ed254e55;
}

.output-panel textarea {
  color: var(--text-secondary);
  background: var(--surface);
}

.editor-footer {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  color: var(--text-muted);
  border-top: 1px solid var(--line);
  font-size: 10px;
}

.editor-footer .is-error {
  color: #c44b61;
}

.transfer-mark {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--watermelon);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 7px #28264b0d;
  transform: translate(-50%, -50%);
}

.transfer-mark svg {
  width: 19px;
  height: 19px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 21px;
}

.keyboard-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: #a0a3b0;
  font-size: 11px;
}

kbd {
  padding: 4px 6px;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-subtle);
  font-family: "DM Sans", sans-serif;
  font-size: 10px;
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.clear-button,
.convert-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease;
}

.clear-button:active,
.convert-button:active {
  transform: translateY(1px);
}

.clear-button {
  padding: 0 13px;
  color: var(--text-secondary);
  border: 1px solid var(--line);
  background: var(--surface);
}

.clear-button:hover {
  background: var(--surface-subtle);
}

.convert-button {
  gap: 9px;
  padding: 0 13px;
  color: var(--prussian-blue);
  border: 1px solid var(--royal-gold);
  background: var(--royal-gold);
  box-shadow: 0 3px 8px #f9dc5c55;
}

.convert-button:hover {
  border-color: #e7c633;
  background: #e7c633;
  box-shadow: 0 4px 11px #f9dc5c66;
}

.convert-button svg {
  width: 15px;
  height: 15px;
}

.privacy-card {
  display: flex;
  min-height: 84px;
  align-items: center;
  gap: 13px;
  margin-top: 15px;
  padding: 15px 18px;
  border: 1px solid #d7ead2;
  border-radius: 10px;
  background: linear-gradient(105deg, #eff8ed 0%, #f7fbf5 55%, #fbfcfb 100%);
}

.privacy-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--prussian-blue);
  border: 1px solid #d7ead2;
  border-radius: 10px;
  background: #fff;
}

.privacy-icon svg {
  width: 20px;
  height: 20px;
}

.privacy-copy h2 {
  margin-bottom: 3px;
  color: var(--prussian-blue);
  font-size: 12px;
  font-weight: 700;
}

.privacy-copy p {
  margin-bottom: 0;
  color: var(--charcoal-blue);
  font-size: 11px;
  line-height: 1.5;
}

.privacy-check {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  margin-left: auto;
  color: var(--prussian-blue);
  border: 1px solid #d7ead2;
  border-radius: 50%;
  background: #fff;
  font-size: 11px;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  color: #a5a7b3;
  font-size: 11px;
}

.footer-version {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-version span {
  width: 5px;
  height: 5px;
}

.toast {
  position: fixed;
  z-index: 5;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 15px;
  color: #fff;
  border: 1px solid #ffffff22;
  border-radius: 8px;
  background: var(--prussian-blue);
  box-shadow: 0 7px 24px #01193630;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(7px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--watermelon);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --page-background: #011126;
  --surface: #172e43;
  --surface-subtle: #20384c;
  --text-primary: #f5f7f8;
  --text-secondary: #e5ebed;
  --text-muted: #b0bec6;
  --line: #465362;
  --accent: #b51f43;
  --accent-soft: #402637;
  --highlight: #bca33d;
  --positive: #91b58c;
}

html[data-theme="dark"] .brand-mark {
  background: var(--accent);
  box-shadow: 0 5px 14px #b51f4344;
}

html[data-theme="dark"] .brand-name span,
html[data-theme="dark"] .eyebrow-dot {
  color: var(--highlight);
}

html[data-theme="dark"] .eyebrow-dot {
  background: var(--highlight);
}

html[data-theme="dark"] .sidebar {
  color: #e5ebed;
}

html[data-theme="dark"] .sidebar-label,
html[data-theme="dark"] .profile-caption {
  color: #b0bec6;
}

html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .profile-name {
  color: #f5f7f8;
}

html[data-theme="dark"] .nav-icon {
  color: var(--positive);
}

html[data-theme="dark"] .topbar {
  border-color: var(--line);
}

html[data-theme="dark"] .breadcrumbs,
html[data-theme="dark"] .local-indicator,
html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .page-description,
html[data-theme="dark"] .card-top p,
html[data-theme="dark"] .keyboard-hint,
html[data-theme="dark"] .page-footer {
  color: var(--text-muted);
}

html[data-theme="dark"] .breadcrumb-current,
html[data-theme="dark"] .card-top h2,
html[data-theme="dark"] .editor-heading label {
  color: var(--text-primary);
}

html[data-theme="dark"] .heading-badge {
  color: #f3e5a4;
  border-color: #6c6038;
  background: #343521;
}

html[data-theme="dark"] .direction-button.selected {
  color: var(--text-primary);
}

html[data-theme="dark"] .format-pill {
  color: #f3e5a4;
  background: #343521;
}

html[data-theme="dark"] .output-format {
  color: #d5dfe3;
  background: #344656;
}

html[data-theme="dark"] .editor-panel textarea::placeholder {
  color: #a7b4bd;
}

html[data-theme="dark"] .editor-footer .is-error {
  color: #ff8b9f;
}

html[data-theme="dark"] .transfer-mark {
  color: #ff8197;
}

html[data-theme="dark"] .clear-button:hover {
  background: #263f53;
}

html[data-theme="dark"] .convert-button {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 3px 8px #b51f4340;
}

html[data-theme="dark"] .convert-button:hover {
  border-color: #c72a4e;
  background: #c72a4e;
  box-shadow: 0 4px 11px #b51f4355;
}

html[data-theme="dark"] .privacy-card {
  border-color: #465362;
  background: linear-gradient(105deg, #203b3d 0%, #203746 55%, #263747 100%);
}

html[data-theme="dark"] .privacy-icon,
html[data-theme="dark"] .privacy-check {
  color: var(--positive);
  border-color: #465362;
  background: #172e43;
}

html[data-theme="dark"] .privacy-copy h2 {
  color: #e6f2e2;
}

html[data-theme="dark"] .privacy-copy p {
  color: #c4d4c2;
}

html[data-theme="dark"] .theme-toggle {
  color: #f3e5a4;
  border-color: var(--line);
  background: var(--surface);
}

html[data-theme="dark"] .theme-toggle:hover {
  color: #fff;
  border-color: var(--tea-green);
  background: var(--surface-subtle);
}

html[data-theme="dark"] .moon-icon {
  display: none;
}

html[data-theme="dark"] .sun-icon {
  display: block;
}

html[data-theme="dark"] .toast.error {
  background: #9e2945;
}

@media (min-width: 1400px) {
  .page-content {
    padding-top: 68px;
  }
}

@media (max-width: 1000px) {
  .sidebar {
    width: 218px;
  }

  .main-content {
    margin-left: 218px;
  }

  .topbar {
    padding: 0 30px;
  }

  .page-content {
    padding: 40px 30px 25px;
  }

  .converter-card {
    padding-right: 19px;
    padding-left: 19px;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: static;
    width: auto;
    height: 62px;
    flex-direction: row;
    align-items: center;
    padding: 0 18px;
  }

  .sidebar-section,
  .sidebar-bottom {
    display: none;
  }

  .main-content {
    margin-left: 0;
  }

  .topbar {
    height: 53px;
    padding: 0 20px;
  }

  .topbar-right {
    gap: 11px;
  }

  .local-indicator {
    font-size: 0;
  }

  .local-indicator span {
    width: 7px;
    height: 7px;
  }

  .page-content {
    padding: 34px 20px 24px;
  }

  .converter-card {
    margin-top: 23px;
  }
}

@media (max-width: 540px) {
  .heading-row {
    align-items: flex-start;
  }

  .heading-badge {
    margin-top: 4px;
    padding: 6px 8px;
    font-size: 10px;
  }

  .page-description {
    max-width: 320px;
  }

  .converter-card {
    padding: 22px 18px 18px;
  }

  .card-top {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 16px;
  }

  .editor-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .editor-panel textarea {
    height: 165px;
  }

  .transfer-mark {
    top: 50%;
    transform: translate(-50%, -50%) rotate(90deg);
  }

  .card-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-buttons {
    width: 100%;
    justify-content: flex-end;
  }

  .privacy-card {
    align-items: flex-start;
    padding: 12px;
  }

  .privacy-check {
    display: none;
  }

  .page-footer {
    margin-top: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
