:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #20382e;
  background: #f5f5ef;
  line-height: 1.5;
  font-synthesis: none;
  --green: #2c624b;
  --muted: #647368;
  --border: #dfe4da;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 13px 21px;
  border: 1px solid var(--green);
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.15s;
}
button:hover:not(:disabled),
.button:hover {
  background: #204d3a;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button > span[aria-hidden],
.button > span[aria-hidden] {
  font-size: 19px;
  line-height: 1;
  font-weight: 400;
}
:focus-visible {
  outline: 3px solid #9fbc8d;
  outline-offset: 4px;
}
.button-secondary {
  color: #365b47;
  border-color: #cbd5c6;
  background: transparent;
}
.button-secondary:hover:not(:disabled) {
  background: #e8ede2;
}
.button-text {
  padding: 10px 4px;
  background: none;
  border: 0;
  color: #5b6c60;
  font-weight: 500;
}
.button-text:hover:not(:disabled) {
  background: transparent;
  color: #20382e;
}
.site-header,
main,
.site-footer {
  width: min(1120px, calc(100% - 80px));
  margin: auto;
}
.site-header {
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #20382e;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.8px;
  text-decoration: none;
}
.brand-mark {
  display: inline-flex;
  width: 33px;
  height: 33px;
  align-items: center;
  justify-content: center;
  background: #dfe9d0;
  border-radius: 11px;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 23px;
  letter-spacing: -4px;
  padding-right: 4px;
}
.brand-mark span {
  transform: translateY(2px);
}
.preview-tag {
  margin-left: 8px;
  border: 1px solid #d4ddca;
  border-radius: 5px;
  color: #718362;
  padding: 3px 6px;
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 600;
}
.header-note {
  color: var(--muted);
  font-size: 12px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.language-picker select {
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--green);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  list-style: none;
  padding: 0;
  margin: 30px 0 0;
  font-size: 12px;
  color: #8b948a;
}
.steps li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.steps li[aria-current] {
  color: #325d45;
  font-weight: 650;
}
.steps li > span:first-child {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6dece;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 9px;
}
.steps li[aria-current] > span:first-child {
  background: #e1eace;
  border-color: #d3dfbf;
}
.upload-view {
  text-align: center;
  padding: 68px 0 56px;
}
.eyebrow {
  margin: 0 0 14px;
  color: #5e734e;
  font-size: 10px;
  letter-spacing: 1.6px;
  font-weight: 650;
}
h1,
h2,
p {
  margin-top: 0;
}
.upload-view h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(44px, 6vw, 66px);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -2.8px;
  margin: 0 0 21px;
}
.upload-view h1 > span:not(.hero-title) {
  color: #698457;
  font-style: italic;
}
.intro {
  color: #748075;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 32px;
}
.upload-card {
  max-width: 640px;
  margin: 0 auto;
  padding: 10px;
  background: #fff;
  border: 1px solid #e0e5d9;
  border-radius: 18px;
  box-shadow: 0 10px 35px #30462806;
}
.drop-zone {
  display: flex;
  min-height: 184px;
  position: relative;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed #cbd7c0;
  border-radius: 11px;
  background: #fafbf7;
  cursor: pointer;
  padding: 22px;
}
.drop-zone.is-dragging,
.drop-zone:focus-within {
  background: #edf3e4;
  border-color: #698457;
}
.upload-icon {
  width: 34px;
  height: 34px;
  color: #64835b;
  margin-bottom: 14px;
}
.file-title {
  max-width: 100%;
  font-size: 16px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.muted {
  color: var(--muted);
  font-size: 12px;
}
.file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 8px 5px;
}
.upload-card-footer > span {
  color: #89917e;
  font-size: 11px;
}
.upload-progress {
  margin: 14px 8px 6px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: left;
}
.upload-progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #365b47;
  font-size: 12px;
}
.upload-progress p {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--muted);
}
.benefits {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 25px;
  color: #66775d;
  margin: 25px 0 12px;
  font-size: 11px;
}
.benefits b {
  margin-right: 5px;
  color: #708c5b;
}
.small-note {
  color: #65735c;
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}
.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 48px 0 24px;
}
.workspace-heading .eyebrow {
  margin-bottom: 7px;
}
.workspace-heading h1 {
  font-size: 30px;
  font-weight: 550;
  line-height: 1.2;
  letter-spacing: -1.1px;
  margin-bottom: 8px;
}
#video-name {
  margin: 0;
  overflow-wrap: anywhere;
}
.status-panel {
  border: 1px solid #d9e1d0;
  border-radius: 14px;
  padding: 20px 22px;
  background: #edf2e5;
  margin-bottom: 24px;
}
.status-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.status-heading p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
#progress-label {
  margin-left: auto;
  color: #7d8e6c;
  font-size: 11px;
}
.status-indicator {
  width: 8px;
  height: 8px;
  background: #77935e;
  border-radius: 50%;
  animation: breathe 1.7s infinite;
}
.status-panel[data-done='true'] .status-indicator {
  animation: none;
}
.status-panel[data-done='true'] progress {
  display: none;
}
progress {
  display: block;
  width: 100%;
  height: 5px;
  margin: 14px 0 10px;
  accent-color: #698457;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: #dbe4d0;
}
progress::-webkit-progress-value {
  background: #698457;
}
#status-note {
  margin: 7px 0 0;
}
.result-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 32px;
  align-items: start;
  margin-bottom: 48px;
}
.video-shell {
  background: #17231d;
  border-radius: 15px;
  overflow: hidden;
  line-height: 0;
}
video {
  display: block;
  width: 100%;
  max-height: 590px;
  min-height: 220px;
  object-fit: contain;
}
.result-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 15px 0 18px;
  color: #748268;
  font-size: 11px;
}
.download-button {
  width: 100%;
  justify-content: space-between;
}
#share-video {
  width: 100%;
  margin-top: 8px;
}
.enhancement-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 12px;
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  color: #52654a;
  font-size: 11px;
}
.enhancement-summary li::before {
  content: '✓ ';
  color: var(--green);
}
.feedback-card {
  margin-top: 24px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}
.feedback-card h2 {
  font-size: 21px;
}
.feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.feedback-actions p {
  width: 100%;
  margin: 0;
  font-size: 12px;
}
.feedback-actions button {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 12px;
}
#download-note {
  margin-top: 10px;
}
.editor-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 25px;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.editor-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 8px;
}
h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.6px;
  font-size: 25px;
  line-height: 1.2;
  margin-bottom: 0;
}
.count-badge {
  padding: 5px 8px;
  background: #f0f3e9;
  border-radius: 6px;
  color: #7b8c6c;
  font-size: 10px;
  white-space: nowrap;
}
.editor-description {
  color: #899182;
  font-size: 12px;
  line-height: 1.7;
  margin: 15px 0 22px;
}
.caption-list {
  max-height: 540px;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 5px;
}
.subtitle-options {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.preset-fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 16px;
  min-width: 0;
}
.preset-fieldset legend {
  padding: 0;
  margin-bottom: 8px;
  color: #52654a;
  font-size: 12px;
  font-weight: 600;
}
.style-options,
.position-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.preset-choice {
  position: relative;
  cursor: pointer;
  min-width: 0;
}
.preset-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.preset-choice > span {
  display: block;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
}
.preset-choice input:checked + span {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
  background: #f2f6ec;
}
.preset-choice input:focus-visible + span {
  outline: 3px solid #9fbc8d;
  outline-offset: 3px;
}
.preset-choice input:disabled + span {
  opacity: 0.5;
  cursor: default;
}
.style-sample {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 54px;
  background: #8b998b;
  color: white;
  font-size: 12px;
  font-weight: 700;
  text-shadow:
    -1px -1px 0 #26352c,
    1px -1px 0 #26352c,
    -1px 1px 0 #26352c,
    1px 1px 0 #26352c;
}
.sample-highlight b {
  color: #99e3ff;
}
.sample-bold {
  text-shadow: none;
}
.sample-bold b {
  padding: 2px 4px;
  border-radius: 2px;
  background: #19231ed9;
  font-size: 14px;
}
.preset-name,
.preset-detail {
  display: block;
}
.preset-name {
  margin: 8px 0 2px;
  font-size: 12px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.preset-detail {
  padding: 0 3px 9px;
  color: var(--muted);
  font-size: 9px;
}
.position-options .preset-choice > span {
  padding: 11px 4px;
  font-size: 12px;
}
.preset-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.style-preview {
  margin: 0 0 20px;
}
.style-preview figcaption {
  margin-bottom: 8px;
  color: #52654a;
  font-size: 12px;
  font-weight: 600;
}
.style-preview-frame {
  display: flex;
  justify-content: center;
  background: #17231d;
  border-radius: 10px;
  overflow: hidden;
}
.style-preview canvas {
  display: block;
  max-width: 100%;
  max-height: 250px;
  width: auto;
  height: auto;
}
.style-preview p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 8px 0 0;
}
#style-preview-unavailable {
  margin-bottom: 16px;
}
.recent-videos {
  margin: 40px 0;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.recent-heading .small-note {
  text-align: left;
  margin: 10px 0 20px;
}
.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
  gap: 12px;
}
.recent-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}
.recent-card:hover {
  border-color: #9db48b;
}
.recent-card[aria-disabled='true'] {
  opacity: 0.5;
  cursor: default;
}
.recent-thumbnail {
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 64px;
  height: 78px;
  border-radius: 6px;
  overflow: hidden;
  background: #e8ede2;
  color: #65755b;
  font-size: 24px;
}
.recent-thumbnail img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-details {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.recent-details strong {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-status {
  color: #65755b;
  font-size: 12px;
}
.status-failed {
  color: #8e4a35;
}
.recent-expiry {
  color: var(--muted);
  font-size: 10px;
}
.caption-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid #edf0e8;
  padding: 12px 0;
}
.caption-row:first-child {
  padding-top: 0;
}
.timestamp {
  border: 0;
  background: #f3f5ed;
  color: #7b8d69;
  padding: 5px 6px;
  margin-top: 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.timestamp:hover:not(:disabled) {
  background: #e5eddc;
}
.caption-row.is-current .timestamp {
  color: #fff;
  background: #698457;
}
.caption-label {
  display: block;
  color: #65755b;
  font-size: 10px;
  margin-bottom: 4px;
}
textarea {
  display: block;
  width: 100%;
  resize: vertical;
  min-height: 64px;
  max-height: 160px;
  background: #fff;
  color: #354a38;
  padding: 9px 11px;
  border: 1px solid #e2e7dc;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
textarea:focus {
  border-color: #9db48b;
}
.caption-row.is-edited textarea {
  border-color: #a5ba91;
  background: #fbfdf7;
}
textarea:disabled {
  color: #7f8a7a;
  background: #f6f7f3;
}
.character-count {
  display: block;
  text-align: right;
  margin-top: 3px;
  color: #65755b;
  font-size: 9px;
}
.editor-footer {
  padding-top: 18px;
}
.editor-footer p {
  margin-bottom: 12px;
}
.editor-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.editor-actions button {
  font-size: 12px;
}
.error-panel {
  margin: 24px auto;
  padding: 20px;
  border: 1px solid #e5cec1;
  border-radius: 12px;
  background: #fcf3ee;
  color: #8e4a35;
  max-width: 700px;
  font-size: 14px;
}
.error-panel p {
  margin: 0;
}
.error-panel button {
  margin: 12px 12px 0 0;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0 30px;
  border-top: 1px solid var(--border);
  color: #65735c;
  font-size: 10px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
[hidden] {
  display: none !important;
}
@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 760px) {
  textarea {
    font-size: 16px;
  }
  .timestamp {
    min-height: 44px;
    min-width: 44px;
    font-size: 11px;
  }
  #new-video {
    min-height: 44px;
  }
  .site-header,
  main,
  .site-footer {
    width: calc(100% - 36px);
  }
  .site-header {
    height: 80px;
  }
  .header-note {
    display: none;
  }
  .site-header {
    gap: 12px;
  }
  .header-actions {
    flex-shrink: 0;
  }
  .preview-tag {
    display: none;
  }
  .steps {
    font-size: 10px;
    gap: 16px;
    margin-top: 24px;
  }
  .steps li {
    gap: 5px;
  }
  .steps li > span:first-child {
    flex-shrink: 0;
  }
  .upload-view {
    padding: 50px 0 42px;
  }
  .upload-view h1 {
    font-size: 53px;
  }
  html[lang='ru'] .upload-view h1 {
    font-size: clamp(28px, 7.6vw, 53px);
    letter-spacing: -1.3px;
    line-height: 1.2;
  }
  .intro {
    font-size: 13px;
  }
  .desktop-break {
    display: none;
  }
  .result-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .preview-column {
    position: static;
  }
  video {
    max-height: 58vh;
  }
  .workspace-heading {
    margin-top: 32px;
    align-items: start;
  }
  .workspace-heading h1 {
    font-size: 25px;
  }
  #new-video {
    font-size: 11px;
    padding: 8px 12px;
    gap: 8px;
    white-space: nowrap;
  }
  .editor-card {
    padding: 20px;
  }
  .caption-list {
    max-height: none;
    overflow: visible;
  }
  .site-footer {
    flex-direction: column;
    gap: 6px;
  }
  .status-panel {
    padding: 16px;
  }
}
@media (max-width: 400px) {
  .upload-view h1 {
    font-size: 45px;
  }
  .upload-card-footer {
    flex-direction: column;
    padding-bottom: 4px;
    gap: 10px;
  }
  .upload-card-footer button {
    width: 100%;
  }
  .benefits {
    gap: 12px;
    font-size: 10px;
  }
  .steps {
    gap: 11px;
  }
  .steps li > span:first-child {
    width: 20px;
    height: 20px;
  }
  .caption-row {
    grid-template-columns: 45px minmax(0, 1fr);
    gap: 8px;
  }
  .editor-actions {
    gap: 10px;
  }
}

.auth-card {
  max-width: 460px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--surface, #fff);
  border: 1px solid #deded5;
  border-radius: 20px;
}
.auth-card h1 {
  font-size: 2.5rem;
  margin: 0.5rem 0 1rem;
}
.auth-card form,
.auth-card label {
  display: grid;
  gap: 0.6rem;
}
.auth-card form {
  gap: 1rem;
}
.auth-card input {
  width: 100%;
  min-width: 0;
  padding: 0.8rem;
  font: inherit;
  border: 1px solid #bbbdb2;
  border-radius: 8px;
  background: #fff;
  color: #20261e;
}
.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  gap: 10px;
  border: 1px solid #747775;
  border-radius: 4px;
  background: white;
  color: #1f1f1f;
  font:
    500 14px/20px 'Google Sans',
    Arial,
    sans-serif;
  text-decoration: none;
}
.google-button img {
  flex-shrink: 0;
}
.google-button:hover {
  background: #f2f2f2;
  color: #1f1f1f;
}
#google-sign-in {
  width: 100%;
  margin-top: 1rem;
}
.account-security {
  max-width: 460px;
  margin: 2rem 0;
  padding: 1.3rem;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.account-security h2 {
  font-size: 1rem;
}
#google-link-form,
#google-link-form label {
  display: grid;
  gap: 0.6rem;
}
#google-link-password {
  min-width: 0;
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #bbbdb2;
  border-radius: 8px;
  background: white;
  color: #20261e;
  font: inherit;
}
.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}
.account-email {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.8rem;
}
.danger {
  color: #a02f25;
}
.recent-item {
  min-width: 0;
}
#library-more {
  margin-top: 1rem;
}
@media (max-width: 600px) {
  .site-header {
    height: auto;
    min-height: 80px;
    flex-wrap: wrap;
    padding: 16px 0;
  }
  .auth-card {
    padding: 1.3rem;
    margin: 1.5rem auto;
  }
  .account-email {
    max-width: 110px;
  }
  .header-actions {
    flex-shrink: 1;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
  }
}
