.container {
  width: min(1120px, calc(100vw - 48px));
  margin: 0 auto;
  padding: 0 24px;
}

.site-header {
  border-bottom: 1px dashed var(--color-border);
  background: var(--color-header);
}

.header-row {
  display: flex;
  min-height: 108px;
  align-items: center;
  gap: 16px;
}

.wordmark {
  color: var(--color-text);
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -.02em;
  text-decoration: none;
}

.translate-shell { padding-top: 48px; }

.mode-tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--color-border);
}

.mode-tabs button {
  position: relative;
  padding: 0 2px 12px;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  font-weight: 650;
}

.mode-tabs button[aria-selected="true"] { color: var(--color-text); }
.mode-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--color-accent);
  content: "";
}

.language-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--color-border);
  border-bottom: 0;
  border-radius: 14px 14px 0 0;
  background: var(--color-header);
}

.language-bar label { min-width: 0; }

.language-bar select {
  width: 100%;
  height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px 14px 0 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font-weight: 650;
}

.language-bar select:focus-visible { box-shadow: inset 0 -2px var(--color-accent); }

.icon-button {
  border: 0;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
}

.swap-button {
  width: 38px;
  height: 38px;
  justify-self: center;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}

.swap-button:hover { background: var(--color-card-strong); color: var(--color-text); }

.translator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0 0 14px 14px;
  background: var(--color-input-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.translation-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.source-panel { border-right: 1px dashed var(--color-border); }

textarea,
.result-text {
  width: 100%;
  min-height: 250px;
  flex: 1;
  padding: 24px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 22px;
  line-height: 1.5;
}

textarea { resize: none; }
textarea::placeholder, .placeholder { color: var(--color-muted-2); }

.result-panel { background: var(--color-card); }
.result-text { white-space: pre-wrap; }
.result-text.is-loading { opacity: .58; }

.panel-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 1px dashed var(--color-border);
}

.result-footer { justify-content: flex-end; }

.text-button {
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
}

.text-button:hover:not(:disabled) { background: var(--color-card-strong); color: var(--color-accent-hover); }
.text-button:disabled { color: var(--color-muted-2); cursor: default; opacity: .55; }
.character-count { margin-left: auto; color: var(--color-muted-2); font-size: 12px; font-variant-numeric: tabular-nums; }

.primary-button {
  min-width: 104px;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  font-weight: 650;
}

.primary-button:hover:not(:disabled) { background: var(--color-accent-hover); }
.primary-button:disabled { cursor: default; opacity: .45; }
.status { margin: 12px 0 48px; color: var(--color-muted); font-size: 13px; }
.status output { font-variant-numeric: tabular-nums; font-weight: 650; }

.website-panel {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0 0 14px 14px;
  background: var(--color-input-bg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

.website-form {
  display: flex;
  gap: 10px;
  padding: 24px;
}

.website-form input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  outline: 0;
  background: var(--color-input-bg);
  color: var(--color-text);
}

.website-form input::placeholder { color: var(--color-muted-2); }
.website-form input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 2px var(--color-focus); }
.website-form .primary-button { height: 42px; flex: 0 0 auto; white-space: nowrap; }

.website-status {
  margin: 0;
  padding: 0 24px 20px;
  color: var(--color-muted);
  font-size: 13px;
}

.website-status:empty { display: none; }

#website-preview {
  display: block;
  width: 100%;
  height: min(72vh, 780px);
  border: 0;
  border-top: 1px dashed var(--color-border);
  background: #fff;
}

body.website-translating {
  display: grid;
  height: 100vh;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

body.website-translating .site-header,
body.website-translating .mode-tabs { display: none; }

body.website-translating main {
  height: 100%;
  min-height: 0;
}

body.website-translating .translate-shell {
  display: grid;
  width: 100%;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
}

body.website-translating .language-bar {
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

body.website-translating .language-bar select { height: 50px; }

body.website-translating .website-panel {
  display: flex;
  min-height: 0;
  flex-direction: column;
  border: 0;
  border-top: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}

body.website-translating .website-form {
  padding: 12px 24px;
  background: var(--color-header);
}

body.website-translating .website-status { padding: 8px 24px; }

body.website-translating #website-preview {
  height: 0;
  min-height: 0;
  flex: 1 1 0;
}

@media (max-width: 700px) {
  .container { width: 100%; padding-inline: 16px; }
  .header-row { min-height: 92px; }
  .translate-shell { padding-top: 24px; }
  .language-bar { grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); }
  .language-bar select { height: 50px; padding-inline: 12px; font-size: 13px; }
  .translator { grid-template-columns: 1fr; }
  .source-panel { border-right: 0; border-bottom: 1px dashed var(--color-border); }
  textarea, .result-text { min-height: 190px; padding: 18px; font-size: 19px; }
  .website-form { flex-direction: column; padding: 16px; }
  .primary-button { width: 100%; }
  #website-preview { height: 68vh; }
  body.website-translating .website-form { padding: 10px 16px; }
  body.website-translating #website-preview { height: 0; }
}
