@font-face {
  font-family: 'Olymp Display';
  src: url('/assets/olymp-display-semibold.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  color: #fff;
  background: #030534;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: linear-gradient(180deg, #030532 0%, #11194f 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(24px, 5vw, 80px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background: #030532;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand img {
  display: block;
  width: 112px;
  height: auto;
}

.brand-divider {
  width: 1px;
  height: 25px;
  flex: none;
  background: rgba(255, 255, 255, 0.3);
}

.brand-name {
  font-family: 'Olymp Display', Arial, sans-serif;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}

.document-link {
  color: #f7b636;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  text-decoration: none;
}

.document-link:hover {
  color: #ffd174;
  text-decoration: underline;
}

.main {
  width: min(100% - 40px, 720px);
  margin: clamp(32px, 5vh, 56px) auto 48px;
  flex: 1;
}

h1 {
  margin: 0;
  font-family: 'Olymp Display', Arial, sans-serif;
  font-size: clamp(30px, 4.2vw, 42px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.lead {
  max-width: 650px;
  margin: 12px 0 0;
  color: #b7bedf;
  font-size: clamp(14px, 1.8vw, 17px);
  line-height: 1.55;
}

.converter {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid #384680;
  border-radius: 16px;
  background: #161f5c;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.converter > label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}

.input-wrap {
  display: flex;
  align-items: center;
  min-height: 54px;
  border: 1px solid #47558f;
  border-radius: 12px;
  background: #262f67;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.input-wrap:focus-within {
  border-color: #f7b636;
  box-shadow: 0 0 0 4px rgba(247, 182, 54, 0.2);
}

.input-icon {
  padding: 0 13px 0 16px;
  color: #b7bedf;
  font-size: 21px;
}

.input-wrap input {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #f0f2ff;
  font-size: 15px;
}

.input-wrap input::placeholder {
  color: #b7bedf;
}

.clear-button {
  width: 38px;
  height: 38px;
  flex: none;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #b7bedf;
  font-size: 22px;
}

.clear-button:hover {
  background: #384680;
  color: #fff;
}

.website-open-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid #47558f;
  border-radius: 8px;
  background: #303a78;
  color: #d7dcf4;
  text-decoration: none;
}

.website-open-button:hover {
  border-color: #f7b636;
  color: #f7b636;
}

.website-open-button svg {
  width: 19px;
  height: 19px;
}

.input-open-button {
  margin-right: 4px;
  background: transparent;
}

.input-help {
  margin: 8px 2px 0;
  color: #b7bedf;
  font-size: 12px;
  line-height: 1.5;
}

.result-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #47558f;
  border-radius: 14px;
  background: #262f67;
  color: #f0f2ff;
}

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

.result-kicker {
  color: #f7b636;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.result-heading h2 {
  margin: 6px 0 0;
  font-family: 'Olymp Display', Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}

.favorite-button {
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid #47558f;
  border-radius: 10px;
  background: #303a78;
  color: #b7bedf;
  font-size: 22px;
  line-height: 1;
}

.favorite-button:hover,
.favorite-button[aria-pressed='true'] {
  color: #f7b636;
  border-color: #f7b636;
}

.deeplink-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-top: 16px;
}

.deeplink {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  border: 1px solid #47558f;
  border-radius: 10px;
  background: #161f5c;
  color: #f0f2ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
  user-select: all;
}

.copy-button {
  flex: none;
  min-width: 135px;
  padding: 0 14px;
  border: 1px solid #e8a72b;
  border-radius: 10px;
  background: #f7b636;
  color: #030534;
  font-family: 'Olymp Display', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.15s,
    transform 0.2s;
}

.copy-button:hover {
  background: #ffd174;
}

.copy-button.is-copied,
.saved-copy-button.is-copied {
  animation: copy-confirm 0.3s ease-out;
}

.copy-button.is-copied {
  background: #f8c154;
}

.saved-copy-button.is-copied {
  border-color: #f7b636;
  color: #f7b636;
}

@keyframes copy-confirm {
  0% {
    transform: scale(0.96);
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .copy-button.is-copied,
  .saved-copy-button.is-copied {
    animation: none;
  }
}

.copy-status {
  margin: 10px 2px 0;
  color: #f7b636;
  font-size: 13px;
}

.details {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #47558f;
}

.detail-group {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.detail-label {
  color: #b7bedf;
  font-weight: 700;
}

.detail-group ul {
  margin: 0;
  padding-left: 18px;
  color: #e3e7fb;
}

.detail-group li + li {
  margin-top: 5px;
}

.ignored .detail-label,
.ignored ul {
  color: #f4cf83;
}

.error-card {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #de0018;
  border-radius: 12px;
  background: #4b2244;
  color: #ffdce2;
}

.error-card strong {
  font-size: 15px;
}

.error-card p {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.5;
}

.saved-section {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid #384680;
  border-radius: 16px;
  background: #161f5c;
}

.saved-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.saved-heading h2 {
  margin: 0;
  font-family: 'Olymp Display', Arial, sans-serif;
  font-size: 19px;
  font-weight: 600;
}

.saved-heading p {
  margin: 8px 0 0;
  color: #b7bedf;
  font-size: 13px;
  line-height: 1.5;
}

.clear-data-button {
  flex: none;
  padding: 9px 12px;
  border: 1px solid #47558f;
  border-radius: 8px;
  background: transparent;
  color: #e3e7fb;
  font-size: 13px;
}

.clear-data-button:hover:not(:disabled) {
  border-color: #de0018;
  color: #ffdce2;
}

.clear-data-button:disabled {
  opacity: 0.5;
  cursor: default;
}

.saved-tabs {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  border-bottom: 1px solid #47558f;
}

.saved-tabs button {
  padding: 0 2px 12px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #b7bedf;
  font-weight: 600;
}

.saved-tabs button[aria-pressed='true'] {
  border-bottom-color: #f7b636;
  color: #fff;
}

.saved-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.saved-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px;
  border: 1px solid #47558f;
  border-radius: 11px;
  background: #262f67;
}

.saved-item-content {
  flex: 1;
  min-width: 0;
}

.saved-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.saved-item.has-delete .saved-actions {
  padding-right: 24px;
}

.saved-copy-button {
  min-width: 104px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid #47558f;
  border-radius: 8px;
  background: #303a78;
  color: #e3e7fb;
  font-size: 12px;
}

.saved-copy-button:hover {
  border-color: #f7b636;
  color: #f7b636;
}

.saved-delete-button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d7dcf4;
  font-size: 17px;
  line-height: 1;
}

.saved-delete-button:hover {
  color: #ffdce2;
}

.saved-item-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.saved-item-top strong {
  font-size: 14px;
}

.saved-item-top time {
  color: #b7bedf;
  font-size: 12px;
}

.saved-source {
  display: block;
  max-width: 100%;
  margin: 8px 0 5px;
  padding: 0;
  overflow-wrap: anywhere;
  border: 0;
  background: transparent;
  color: #f7b636;
  font-size: 13px;
  text-align: left;
}

.saved-source:hover {
  text-decoration: underline;
}

.saved-item code {
  display: block;
  overflow-wrap: anywhere;
  color: #d7dcf4;
  font-size: 12px;
  line-height: 1.5;
}

.saved-empty,
.saved-notice {
  margin: 18px 0 0;
  color: #b7bedf;
  font-size: 13px;
  line-height: 1.5;
}

.saved-notice {
  color: #f4cf83;
}

.page-footer {
  position: relative;
  width: min(100% - 40px, 720px);
  margin: 0 auto 28px;
}

.footer-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.scheme-toggle {
  min-width: 0;
  max-width: 100%;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #b7bedf;
  font-size: 13px;
  text-align: left;
  overflow-wrap: anywhere;
}

.scheme-toggle strong {
  color: #fff;
  font-weight: 600;
}

.scheme-toggle span {
  margin-left: 12px;
  color: #f7b636;
}

.scheme-toggle:hover span,
.default-scheme-button:hover {
  text-decoration: underline;
}

.scheme-settings {
  position: absolute;
  bottom: calc(100% + 8px);
  z-index: 10;
  width: min(330px, 100%);
  max-height: min(70vh, 360px);
  padding: 16px;
  overflow-y: auto;
  border: 1px solid #384680;
  border-radius: 12px;
  background: #161f5c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

#scheme-settings {
  left: 0;
}

#website-origin-settings {
  right: 0;
}

.scheme-settings p {
  margin: 0 0 12px;
  color: #b7bedf;
  font-size: 13px;
  line-height: 1.5;
}

.default-scheme-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #f7b636;
  font-size: 13px;
  text-align: left;
}

.scheme-settings form {
  margin-top: 16px;
}

.scheme-settings label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.scheme-form-row {
  display: flex;
  gap: 8px;
}

.scheme-form-row input {
  min-width: 0;
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #47558f;
  border-radius: 8px;
  outline: none;
  background: #262f67;
  color: #fff;
  font-size: 14px;
}

.scheme-form-row input::placeholder {
  color: #b7bedf;
}

.scheme-form-row input:focus {
  border-color: #f7b636;
}

.scheme-form-row input[aria-invalid='true'] {
  border-color: #de0018;
}

.scheme-form-row button {
  padding: 0 14px;
  border: 1px solid #e8a72b;
  border-radius: 8px;
  background: #f7b636;
  color: #030534;
  font-size: 13px;
  font-weight: 600;
}

.scheme-settings .scheme-error {
  margin: 8px 0 0;
  color: #ffdce2;
}

:focus-visible {
  outline: 3px solid #f7b636;
  outline-offset: 3px;
}

@media (max-width: 620px) {
  .header {
    min-height: 68px;
    gap: 12px;
    padding: 14px 16px;
  }

  .brand {
    gap: 10px;
  }

  .brand img {
    width: 89px;
  }

  .brand-divider {
    height: 20px;
  }

  .brand-name {
    font-size: 14px;
  }

  .document-link {
    max-width: 134px;
    font-size: 12px;
    line-height: 1.35;
  }

  .main {
    width: min(100% - 32px, 720px);
    margin-top: 32px;
  }

  .converter {
    margin-top: 24px;
    padding: 16px;
  }

  .input-wrap {
    min-height: 54px;
  }

  .input-wrap input {
    height: 52px;
    font-size: 15px;
  }

  .input-icon {
    padding: 0 10px 0 13px;
  }

  .result-card {
    padding: 16px;
  }

  .saved-section {
    padding: 16px;
  }

  .saved-heading {
    flex-direction: column;
    gap: 14px;
  }

  .saved-item {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .saved-item-content {
    padding-right: 24px;
  }

  .saved-actions {
    align-self: flex-end;
    min-height: 36px;
  }

  .page-footer {
    width: min(100% - 32px, 720px);
  }

  .scheme-settings {
    width: 100%;
  }

  #website-origin-settings {
    right: auto;
    left: 0;
  }

  .deeplink-row {
    flex-direction: column;
  }

  .copy-button {
    min-height: 42px;
  }

  .detail-group {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .header {
    flex-wrap: wrap;
  }

  .document-link {
    max-width: none;
    margin-left: auto;
  }
}

.app-version {
  display: block;
  margin-bottom: 8px;
  color: #b7bedf;
  font-size: 11px;
}
