/* Dark is the default, including when JavaScript or browser storage is unavailable. */
:root {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
  color-scheme: dark;
  font-synthesis: none;
  --background: #111714;
  --text: #e4eae5;
  --green: #a3cdb0;
  --green-hover: #b5ddc0;
  --on-accent: #13271b;
  --muted: #a9b4aa;
  --subtle: #95a095;
  --line: #303b33;
  --orange: #dca574;
  --surface: #1b231e;
  --surface-soft: #202b23;
  --surface-hover: #29382d;
  --error: #f4a397;
  --error-border: #74524c;
  --success: #b5d3a6;
  --player: #080d0a;
  --shadow: #00000026;
}
:root[data-theme="light"] {
  color-scheme: light;
  --background: #f5f5ef;
  --text: #263e31;
  --green: #244b3b;
  --green-hover: #32634c;
  --on-accent: #ffffff;
  --muted: #606d5f;
  --subtle: #667261;
  --line: #d5dacf;
  --orange: #ad542f;
  --surface: #ffffff;
  --surface-soft: #e8eddd;
  --surface-hover: #e2e9d9;
  --error: #ad4333;
  --error-border: #ddc0b6;
  --success: #47613a;
  --player: #17241c;
  --shadow: #233d2a0d;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
a {
  color: inherit;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input {
  font: inherit;
}
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 15px;
  border: 1px solid var(--green);
  border-radius: 6px;
  background: var(--green);
  color: var(--on-accent);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
button:hover,
.button:hover {
  background: var(--green-hover);
  text-decoration: none;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button.secondary,
.button.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
button.secondary:hover,
.button.secondary:hover {
  background: var(--surface-hover);
}
button.danger {
  color: var(--error);
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
.site-header {
  max-width: 808px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 600;
  white-space: nowrap;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-link {
  font-size: 13px;
  color: var(--muted);
}
button.theme-toggle {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 400;
}
.home {
  max-width: 808px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}
h1 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.intro {
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.7;
}
#share-form label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
}
.input-row {
  display: flex;
  gap: 8px;
}
input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
}
input::placeholder {
  color: var(--subtle);
}
.limits {
  font-size: 12px;
  color: var(--subtle);
  margin: 8px 0 0;
}
.error {
  color: var(--error);
  font-size: 13px;
  margin: 10px 0 0;
}
.result-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px;
}
.result-panel h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
}
.result-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.actions,
.watch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.actions {
  margin-top: 14px;
}
.actions button,
.actions .button {
  padding: 7px 12px;
  font-size: 13px;
}
.copy-status {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.copy-status:empty {
  display: none;
}
.result-panel .copy-status:not(:empty) {
  margin-top: 10px;
}
.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 12px;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width 0.5s;
}
.progress-bar.busy {
  width: 30%;
  animation: loading 1.8s ease-in-out infinite;
}
.recent-section {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.section-heading h2 span {
  margin-left: 6px;
  font-weight: 400;
}
.section-heading h2 span,
.section-heading > span {
  font-size: 12px;
  color: var(--subtle);
}
.empty-state {
  padding: 20px 0;
  color: var(--subtle);
  font-size: 13px;
}
.empty-state p {
  margin: 0;
}
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.recent-row:last-child {
  border-bottom: 0;
}
.recent-thumb {
  width: 64px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--surface-soft);
  flex-shrink: 0;
}
.recent-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.recent-description {
  min-width: 0;
  flex: 1;
}
.recent-description a {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}
.recent-description p {
  font-size: 12px;
  color: var(--subtle);
  margin: 3px 0 0;
}
.recent-row button {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 400;
}
.watch-main {
  max-width: 808px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}
.watch-main h1 {
  font-size: 22px;
  letter-spacing: -0.3px;
  margin-bottom: 20px;
  overflow-wrap: anywhere;
}
.watch-main video {
  display: block;
  /* Bound both dimensions to preserve portrait, landscape and square frames. */
  width: min(100%, calc(66vh * var(--video-ratio, 1.777778)));
  height: auto;
  aspect-ratio: var(--video-ratio, 16 / 9);
  max-height: 66vh;
  margin-inline: auto;
  object-fit: contain;
  background: var(--player);
  border-radius: 6px;
}
.watch-status {
  padding: 40px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  white-space: pre-line;
}
.video-details {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 14px 0 18px;
}
.video-details a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@keyframes loading {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(440%);
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
@media (max-width: 520px) {
  button,
  .button {
    min-height: 44px;
  }
  .site-header {
    padding: 14px 16px;
    gap: 12px;
  }
  .header-actions {
    gap: 12px;
  }
  .header-link {
    font-size: 12px;
  }
  .home,
  .watch-main {
    padding: 24px 16px 32px;
  }
  h1 {
    font-size: 26px;
  }
  .intro {
    font-size: 13px;
  }
  .input-row {
    flex-wrap: wrap;
  }
  .input-row input {
    flex-basis: 100%;
  }
  .input-row button {
    width: 100%;
  }
  .watch-actions button,
  .watch-actions .button {
    font-size: 13px;
    padding: 8px 10px;
  }
}
@media (max-width: 520px), (pointer: coarse) and (max-height: 520px) {
  .watch-main {
    max-width: none;
    padding-inline: 0;
  }
  .watch-main > :not(video) {
    margin-inline: 16px;
  }
  .watch-main video {
    width: 100%;
    max-height: none;
    border-radius: 0;
  }
}
@media (max-width: 360px) {
  .brand {
    font-size: 17px;
    gap: 6px;
  }
  .brand-mark {
    width: 24px;
    height: 24px;
  }
  .header-actions {
    gap: 8px;
  }
  .header-link {
    max-width: 55px;
  }
}
