:root {
  --bg: #f3f7f8;
  --text: #1f2a33;
  --card: #ffffff;
  --accent: #0f6d67;
  --accent-soft: #d9f0ee;
  --accent-deep: #174f4d;
  --danger: #9f2f2f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, #e2f6f1, var(--bg));
  min-height: 100vh;
}

body.app-body {
  background:
    radial-gradient(circle at top left, rgba(255, 227, 197, 0.9), transparent 28%),
    radial-gradient(circle at top right, rgba(214, 239, 235, 0.95), transparent 34%),
    linear-gradient(180deg, #f8f3ed 0%, #eff7f5 52%, #f3f7f8 100%);
}

.container {
  width: min(1120px, 94vw);
  margin: 22px auto;
}

.app-shell {
  width: min(1220px, 94vw);
  margin: 0 auto;
  padding: 22px 0 36px;
  display: grid;
  gap: 18px;
}

.landing-body {
  background:
    radial-gradient(circle at top left, rgba(255, 227, 197, 0.9), transparent 32%),
    radial-gradient(circle at top right, rgba(214, 239, 235, 0.95), transparent 34%),
    linear-gradient(180deg, #f8f3ed 0%, #eff7f5 52%, #f3f7f8 100%);
}

.landing-shell {
  width: min(1220px, 94vw);
  margin: 0 auto;
  padding: 22px 0 36px;
}

.site-footer {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

.site-footer-link {
  color: #567075;
  font-size: 0.94rem;
  text-decoration: none;
  border-bottom: 1px solid rgba(86, 112, 117, 0.35);
}

.site-footer-link:hover {
  color: var(--accent-deep);
  border-bottom-color: rgba(23, 79, 77, 0.55);
}

.site-owner-value {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--accent-deep);
}

.legal-doc {
  display: grid;
  gap: 14px;
}

.legal-doc h3 {
  margin: 10px 0 0;
  font-size: 1.05rem;
  color: var(--accent-deep);
}

.legal-doc p {
  margin: 0;
  line-height: 1.65;
  color: #34474f;
}

.landing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--accent-deep);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-logo {
  width: 44px;
  height: 44px;
  display: block;
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
}

.brand-wordmark {
  display: inline-block;
  font-size: 1.35rem;
  line-height: 1;
}

.landing-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.landing-auth-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.primary-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 16px 28px rgba(23, 79, 77, 0.18);
}

.primary-link-btn:hover {
  background: linear-gradient(135deg, #103d3b, #0c5a56);
}

.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(420px, 0.82fr);
  gap: 56px;
  align-items: center;
}

.hero-copy {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 9ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4.3vw, 4.15rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: #183330;
}

html[lang="ru"] .hero-copy h1 {
  max-width: 7.8ch;
  font-size: clamp(2.05rem, 3.75vw, 3.55rem);
  line-height: 0.94;
}

.hero-lead,
.hero-language-note {
  margin: 0;
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.6;
  color: #455c60;
}

.hero-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.hero-points li {
  position: relative;
  padding: 14px 16px 14px 46px;
  border: 1px solid rgba(23, 79, 77, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(34, 61, 72, 0.06);
}

.hero-points li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0c78e, var(--accent));
  box-shadow: 0 0 0 6px rgba(217, 240, 238, 0.85);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding-top: 4px;
}

.hero-visual {
  position: relative;
  min-height: 520px;
  display: grid;
  align-content: center;
  justify-items: end;
  min-width: 0;
}

.visual-card {
  position: relative;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 50px rgba(34, 61, 72, 0.13);
  backdrop-filter: blur(7px);
}

.hero-photo-card {
  width: min(100%, 560px);
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.hero-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.06)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 22%, transparent 78%, rgba(255, 255, 255, 0.08));
}

.workbench {
  width: min(1260px, 96vw);
  margin: 20px auto;
  display: grid;
  gap: 10px;
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.product-header-main {
  display: grid;
  gap: 8px;
}

.product-kicker {
  margin: 0;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.product-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #183330;
}

.product-title-compact {
  font-size: clamp(1.7rem, 2.4vw, 2.35rem);
  line-height: 1.05;
  margin-top: 10px;
  margin-bottom: 22px;
}

.product-header .subtitle {
  max-width: 62ch;
}

.product-nav {
  order: -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 1px solid rgba(23, 79, 77, 0.12);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 30px rgba(34, 61, 72, 0.06);
}

.product-nav-links,
.product-nav-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.product-nav-user > form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-picker {
  position: relative;
  display: inline-flex;
}

.lang-current-btn {
  list-style: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(23, 79, 77, 0.2);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-current-btn::-webkit-details-marker {
  display: none;
}

.lang-current-btn:hover {
  border-color: var(--accent-deep);
  background: rgba(217, 240, 238, 0.86);
}

.lang-picker[open] .lang-current-btn {
  border-color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(15, 109, 103, 0.15);
}

.lang-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(23, 79, 77, 0.2);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 28px rgba(34, 61, 72, 0.18);
  z-index: 20;
}

.lang-option-form {
  margin: 0;
}

.lang-option-btn {
  width: 100%;
  border: 1px solid rgba(23, 79, 77, 0.16);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  text-align: left;
}

.lang-option-btn:hover {
  background: rgba(217, 240, 238, 0.55);
  border-color: var(--accent-deep);
}

.lang-option-btn.active {
  border-color: var(--accent-deep);
  background: rgba(217, 240, 238, 0.72);
}

.lang-option-flag {
  font-size: 1rem;
  line-height: 1;
}

.lang-option-label {
  font-size: 0.9rem;
  color: #1f2a33;
}

.product-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: start;
}

.product-card {
  border-radius: 28px;
  border: 1px solid rgba(23, 79, 77, 0.12);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 18px 38px rgba(34, 61, 72, 0.08);
  backdrop-filter: blur(7px);
  padding: 24px;
}

.product-card h2:first-child,
.product-card h3:first-child,
.card h2:first-child {
  margin-top: 0;
}

.intro-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.intro-list li {
  position: relative;
  padding: 14px 16px 14px 44px;
  border-radius: 18px;
  background: rgba(237, 246, 245, 0.82);
  border: 1px solid rgba(15, 109, 103, 0.12);
}

.intro-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 18px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0c78e, var(--accent));
  box-shadow: 0 0 0 5px rgba(217, 240, 238, 0.9);
}

.cta-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.cta-list li,
.cta-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.card-note {
  margin: 0;
  color: #4c5f6a;
}

.home-tariff-expired-note {
  color: #24363f;
  font-weight: 600;
}

.home-tariff-expired-link {
  display: inline-block;
  margin-left: 0.18em;
  padding: 0.02em 0.22em;
  border-radius: 0.3em;
  color: #143db7;
  font-weight: 900;
  font-size: 1.03em;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
  background: rgba(20, 61, 183, 0.08);
}

.home-tariff-expired-link:hover {
  color: #0f2d88;
  background: rgba(20, 61, 183, 0.14);
}

.home-tariff-plans-link {
  font-weight: 700;
}

.youtube-note {
  margin-top: 18px;
}

.example-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.form-card {
  display: grid;
  gap: 14px;
}

.action-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

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

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

.top-actions form,
.header-actions form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-label {
  font-weight: 700;
  color: #0c5a56;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 2px;
}

.home-links {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.subtitle {
  margin: 0;
  color: #4c5f6a;
}

.layout-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, 420px);
  gap: 10px;
  align-items: start;
}

.media-column {
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
}

.transcript-column {
  min-height: 0;
}

.media-card {
  display: grid;
  align-content: start;
  gap: 6px;
}

.card {
  background: var(--card);
  border: 1px solid #d8e2e6;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 8px 22px rgba(17, 38, 52, 0.06);
}

.card-disabled {
  opacity: 0.7;
}

.segments {
  margin: 10px 0 0;
  padding-left: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: min(68vh, 760px);
  overflow-y: auto;
  padding-right: 4px;
}

.segments li {
  display: grid;
  gap: 2px;
  padding: 6px 8px;
  border: 1px solid #d8e2e6;
  border-radius: 8px;
  background: #f9fcfc;
  cursor: default;
}

.segments li:hover {
  border-color: #9bcfc9;
  background: #eef9f7;
}

.segments li:focus {
  outline: 2px solid #2ea79f;
  outline-offset: 1px;
}

.segments li.active {
  border-color: #0f6d67;
  background: #dff4f1;
}

.segments li.selected {
  border-color: #0f6d67;
  box-shadow: inset 0 0 0 2px rgba(15, 109, 103, 0.3);
  background: #ecf8f6;
}

.segments .time {
  font-weight: 700;
  color: #0c5a56;
}

.segments .text {
  color: #223641;
  transition: filter 0.2s ease;
}

.segments .text.blurred {
  filter: blur(6px);
  user-select: none;
}

.settings-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.settings-head h2 {
  margin: 0;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.setting-item input[type="number"] {
  width: 110px;
  padding: 8px;
  border: 1px solid #bfd0d8;
  border-radius: 8px;
}

.secondary-btn {
  background: #edf6f5;
  color: #0f6d67;
  border: 1px solid #9bcfc9;
  padding: 7px 10px;
}

.secondary-btn:hover {
  background: #ddf0ed;
  color: #0a4e4a;
}

.toggle-segment-text {
  justify-self: start;
  margin-top: 4px;
}

.segment-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.transcript-column {
  position: sticky;
  top: 18px;
}

.practice-card-inline {
  align-content: start;
}

.settings-fab {
  position: fixed;
  right: 18px;
  top: 40%;
  z-index: 30;
}

.settings-drawer {
  position: fixed;
  right: 18px;
  top: 14%;
  width: min(360px, 90vw);
  z-index: 25;
  background: #ffffff;
  border: 1px solid #d8e2e6;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 14px 32px rgba(17, 38, 52, 0.16);
}

.practice-card textarea {
  width: 100%;
  border: 1px solid #bfd0d8;
  border-radius: 10px;
  padding: 10px 72px 10px 10px;
  font-size: 0.98rem;
  resize: vertical;
  min-height: 90px;
}

.heard-input-wrap {
  position: relative;
}

.dictation-overlay {
  position: absolute;
  right: 10px;
  top: 10px;
}

.dictation-overlay-btn {
  padding: 6px;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dictation-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.dictation-overlay-btn.active {
  background: #d75454;
  border-color: #c73a3a;
  color: #ffffff;
}

.dictation-status {
  margin-top: 8px;
  color: #3c5866;
  font-size: 0.9rem;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.practice-result {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e2e6;
  border-radius: 8px;
  background: #f7fbfb;
  font-weight: 600;
}

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

  .media-card {
    min-height: auto;
  }

  .transcript-column {
    position: static;
  }

  .segments {
    max-height: 48vh;
  }

  .settings-fab {
    top: auto;
    bottom: 20px;
    right: 14px;
  }
}

.progress {
  width: min(520px, 100%);
  height: 12px;
  background: #d8e2e6;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0f6d67, #2ea79f);
  transition: width 0.6s ease;
}

.error-card {
  border-color: #e7b3b3;
  background: #fff4f4;
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
}

input[type="url"],
input[type="file"],
input[type="text"],
input[type="password"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #bfd0d8;
  border-radius: 8px;
  font-size: 0.95rem;
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

button {
  justify-self: start;
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: #0c5a56;
}

audio,
video {
  width: 100%;
  max-height: 52vh;
}

.link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.auth-container {
  width: min(540px, 94vw);
}

.auth-card {
  display: grid;
  gap: 10px;
}

.auth-shell {
  width: min(1220px, 94vw);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 24px 0;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.auth-promo {
  display: grid;
  gap: 16px;
}

.auth-promo .product-card {
  min-height: 100%;
}

.auth-promo .product-title {
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  line-height: 1.04;
  max-width: 11ch;
  margin-top: 18px;
  margin-bottom: 18px;
}

.auth-promo .subtitle {
  max-width: 58ch;
  margin-bottom: 24px;
}

.auth-promo .intro-list {
  margin-top: 20px;
  margin-bottom: 24px;
}

.auth-card-wrap {
  display: grid;
}

.auth-card.product-card {
  gap: 14px;
}

.auth-error {
  color: #9f2f2f;
  font-weight: 700;
}

.auth-warning {
  background: #fff8dc;
  border: 1px solid #e7d499;
  border-radius: 8px;
  padding: 10px;
}

.auth-help {
  margin: 0;
}

.feedback-visual-card {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 100%;
}

.feedback-image {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(34, 61, 72, 0.14);
}

.feedback-success {
  color: #0c5a56;
  font-weight: 700;
  margin: 0;
}

.feedback-disabled {
  opacity: 0.72;
}

.feedback-dev-note {
  margin: 8px 0 0;
  color: #4c5f6a;
  font-weight: 600;
}

@media (max-width: 980px) {
  .app-shell,
  .landing-header,
  .landing-nav {
    align-items: flex-start;
  }

  .product-header,
  .landing-header {
    flex-direction: column;
  }

  .product-nav {
    align-items: flex-start;
  }

  .landing-nav {
    justify-content: flex-start;
  }

  .product-grid,
  .auth-layout,
  .landing-hero {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    max-width: 11ch;
  }

  .hero-visual {
    min-height: 420px;
    order: 2;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .landing-shell {
    width: min(94vw, 100%);
    padding-top: 18px;
  }

  .brand-link {
    gap: 10px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .brand-wordmark {
    font-size: 1.18rem;
  }

  .hero-copy {
    gap: 14px;
  }

  .hero-copy h1 {
    max-width: none;
    font-size: clamp(2.25rem, 11vw, 3.4rem);
  }

  .hero-points li {
    padding-left: 42px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-link-btn {
    width: 100%;
  }

  .product-nav,
  .product-nav-links,
  .product-nav-user,
  .cta-list li,
  .cta-inline,
  .action-link-row {
    align-items: stretch;
  }

  .hero-visual {
    min-height: 280px;
  }
}

.admin-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 18px 0 0;
}

.admin-menu form {
  margin: 0;
}

.admin-menu-link-active {
  font-weight: 700;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 18px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 12px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
}

.admin-users-name-col {
  text-align: left;
}

.admin-users-usage-col {
  text-align: right;
  white-space: nowrap;
}

.admin-users-actions-col,
.admin-log-date-col,
.admin-log-time-col,
.admin-log-event-col,
.admin-log-file-col {
  text-align: left;
}

.admin-users-table th.admin-users-actions-col,
.admin-users-table td.admin-users-actions-col {
  padding-left: 18px;
  white-space: nowrap;
  width: 110px;
}
