:root {
  --ink: #111814;
  --muted: #69736f;
  --line: rgba(17, 24, 20, 0.12);
  --paper: #f7f2e8;
  --card: rgba(255, 252, 244, 0.92);
  --accent: #1f6f5b;
  --accent-ink: #f9fff9;
  --warm: #d99f4a;
  --danger: #a4382d;
  --shadow: 0 18px 45px rgba(34, 27, 18, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
  background: #efe7d8;
}

body {
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "Avenir Next", "Trebuchet MS", Verdana, sans-serif;
  background:
    radial-gradient(circle at 15% 8%, rgba(217, 159, 74, 0.34), transparent 32rem),
    radial-gradient(circle at 88% 4%, rgba(31, 111, 91, 0.22), transparent 26rem),
    linear-gradient(165deg, #fbf1df 0%, #f5efe5 46%, #dfe9df 100%);
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 760px);
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0 auto;
  padding: 18px 14px 120px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 2px 12px;
  backdrop-filter: blur(18px);
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1 {
  font-size: clamp(1.7rem, 5.8vw, 3.25rem);
  letter-spacing: -0.045em;
}

.global-language-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.88);
  box-shadow: 0 10px 24px rgba(34, 27, 18, 0.08);
}

.global-language-button {
  min-width: 32px;
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 900;
}

.global-language-button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.auth-control {
  position: relative;
  flex: 0 0 auto;
}

.auth-status-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: min(42vw, 220px);
  min-height: 44px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.88);
  color: var(--ink);
  cursor: pointer;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(34, 27, 18, 0.11);
}

.auth-status-button span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-status-button.logged-in {
  padding-left: 6px;
}

.auth-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--accent);
  background-position: center;
  background-size: cover;
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  display: grid;
  gap: 8px;
  width: min(310px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid rgba(17, 24, 20, 0.12);
  border-radius: 18px;
  background: rgba(255, 252, 244, 0.98);
  box-shadow: var(--shadow);
}

.auth-menu-user {
  min-width: 0;
  padding: 4px 4px 8px;
}

.auth-menu-user strong,
.auth-menu-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-menu-user span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.auth-menu-item {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff6e7;
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
  text-align: left;
}

.danger-menu-item {
  color: var(--danger);
}

.auth-menu-telegram {
  display: flex;
  justify-content: center;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff6e7;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 10vw, 4.4rem);
  line-height: 0.9;
  letter-spacing: -0.08em;
}

h2 {
  margin-bottom: 14px;
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.hidden {
  display: none !important;
}

.card {
  min-width: 0;
  margin: 14px 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.login-card {
  min-height: 420px;
  display: grid;
  align-content: center;
  gap: 20px;
}

.login-card p {
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.45;
}

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

.telegram-bot-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
}

.telegram-bot-link svg {
  width: 18px;
  height: 18px;
  fill: #229ed9;
}

.auth-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.login-auth-options {
  --login-provider-width: 280px;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(100%, var(--login-provider-width));
  margin: 18px auto 0;
}

.login-auth-options .auth-provider-button {
  width: 100%;
  height: 40px;
  min-height: 40px;
  gap: 9px;
  padding-inline: 12px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.auth-provider-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  padding: 0 16px;
  border: 1px solid rgba(31, 111, 91, 0.2);
  border-radius: 10px;
  background: #fff6e7;
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
  text-align: center;
}

.provider-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
}

.google-provider {
  border-color: #d7dce3;
  background: #fff;
  color: #374151;
  box-shadow: 0 2px 5px rgba(17, 24, 39, 0.08);
}

.apple-provider {
  border-color: #000;
  background: #000;
  color: #fff;
}

.apple-provider .provider-icon {
  fill: currentColor;
}

.telegram-provider {
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: default;
  padding: 0;
}

.telegram-login-provider {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  background: #4da5e8;
  color: #fff;
}

.telegram-login-faux {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.telegram-login-faux svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

#telegram-login,
#telegram-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
}

.login-auth-options #telegram-login,
.login-auth-options .telegram-provider iframe {
  height: 40px !important;
}

.login-auth-options .telegram-provider iframe {
  width: 100% !important;
  opacity: 0.01;
}

.telegram-provider iframe {
  max-width: 100%;
}

.identity-list {
  display: grid;
  gap: 10px;
}

.identity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.74);
}

.identity-item span {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telegram-connect {
  margin: 0;
}

.home-section {
  display: grid;
  gap: 14px;
}

.hero-card {
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(17, 24, 20, 0.94), rgba(31, 111, 91, 0.86)),
    radial-gradient(circle at 10% 10%, rgba(217, 159, 74, 0.45), transparent 22rem);
  color: #fff8ea;
}

.hero-card h2 {
  font-size: clamp(2rem, 9vw, 4rem);
  line-height: 0.94;
}

.hero-card p:not(.eyebrow) {
  color: rgba(255, 248, 234, 0.76);
  line-height: 1.5;
}

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

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 8px 0 14px;
}

.status-strip > div {
  min-height: 78px;
  padding: 13px 12px;
  border-radius: 22px;
  background: rgba(17, 24, 20, 0.9);
  color: #fff8ea;
}

.label {
  display: block;
  margin-bottom: 7px;
  color: rgba(255, 248, 234, 0.62);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  overflow: hidden;
  font-size: 1.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tabbar {
  position: sticky;
  top: 78px;
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 1.2vw, 8px);
  overflow: visible;
  margin: 0 -14px 12px;
  padding: 8px 14px 12px;
  scrollbar-width: none;
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab-button,
.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
}

.tab-button {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 0 clamp(10px, 1.7vw, 18px);
  background: rgba(255, 252, 244, 0.72);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: clamp(0.86rem, 1.5vw, 1rem);
  text-decoration: none;
}

.tab-button.active {
  background: var(--ink);
  color: #fff8ea;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  outline: none;
  background: #fffaf0;
  color: var(--ink);
}

textarea {
  resize: vertical;
  line-height: 1.36;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(31, 111, 91, 0.55);
  box-shadow: 0 0 0 4px rgba(31, 111, 91, 0.12);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-row input {
  width: 24px;
  min-height: 24px;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.45;
}

.compact-note {
  font-size: 0.8rem;
}

.advanced-options,
.publishing-block {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.62);
}

.advanced-options summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
}

.advanced-options[open] summary {
  margin-bottom: 10px;
}

.publishing-block > strong {
  color: var(--ink);
}

.primary-button {
  width: 100%;
  min-height: 58px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 14px 30px rgba(31, 111, 91, 0.28);
}

.secondary-button {
  padding: 0 18px;
  background: #fff6e7;
  color: var(--accent);
  border: 1px solid rgba(31, 111, 91, 0.2);
}

.secondary-button.small {
  min-height: 38px;
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--danger);
  color: white;
}

.danger-button.small {
  min-height: 38px;
  padding: 0 14px;
}

.danger-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.icon-button {
  min-height: 40px;
  padding: 0 14px;
  background: rgba(17, 24, 20, 0.08);
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.section-head h2 {
  margin-bottom: 0;
}

.list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.list-item {
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 240, 0.74);
}

.list-item a {
  color: var(--accent);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.list-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.42;
}

.movie-grid {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.movie-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.76);
  cursor: default;
}

.movie-card:focus-visible {
  outline: 4px solid rgba(31, 111, 91, 0.24);
  outline-offset: 3px;
}

.movie-card video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #101820;
}

.movie-card-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  cursor: pointer;
}

.movie-card-title,
.movie-detail-title {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

.movie-card-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-card a {
  color: var(--accent);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.movie-card-prompt {
  display: -webkit-box;
  min-height: 2.84em;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-card-prompt strong {
  font-weight: 850;
}

.entity-picker-block,
.entity-toolbar {
  display: grid;
  gap: 10px;
}

.compact-head {
  margin-bottom: 0;
}

.entity-picker-list,
.entity-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.entity-picker-item,
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.78);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.entity-picker-item input {
  width: auto;
  min-height: auto;
}

.entity-chip {
  cursor: pointer;
}

.entity-grid {
  display: grid;
  gap: 12px;
}

.asset-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

.entity-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.66);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.entity-card:hover,
.entity-card:focus-visible {
  border-color: rgba(31, 111, 91, 0.3);
  box-shadow: 0 10px 24px rgba(17, 24, 20, 0.08);
}

.entity-card:focus-visible {
  outline: 3px solid rgba(31, 111, 91, 0.22);
  outline-offset: 2px;
}

.entity-card-image {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 14px;
  background: rgba(31, 111, 91, 0.12);
  object-fit: cover;
}

.entity-card-body {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.entity-card-body h3 {
  margin-bottom: 4px;
}

.entity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entity-tags span {
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(31, 111, 91, 0.1);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.entity-card-code-row {
  grid-column: 1 / -1;
}

.entity-code-row code {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pp-code-link {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pp-code-link code {
  display: block;
}

.pp-code-link:hover code,
.pp-code-link:focus-visible code {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.entity-toolbar {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
}

.asset-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-toolbar input[type="search"] {
  width: min(280px, 100%);
}

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

.asset-detail-image {
  width: auto;
  max-width: min(100%, 760px);
  max-height: min(70vh, 760px);
  height: auto;
  border-radius: 18px;
  object-fit: contain;
  justify-self: start;
  background: rgba(31, 111, 91, 0.12);
}

.asset-history-item {
  padding: 0;
  border: 0;
  background: transparent;
}

.asset-history-item .entity-card {
  border-radius: 20px;
}

.invest-page a {
  color: var(--accent);
  font-weight: 850;
}

.invest-hero-card {
  display: grid;
  gap: 16px;
}

.invest-hero-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.invest-hero-head > div:first-child {
  min-width: 0;
}

.invest-hero-card h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 8vw, 4rem);
  line-height: 0.96;
}

.invest-hero-card p,
.invest-copy-card p {
  margin-bottom: 0;
  color: var(--ink);
  line-height: 1.5;
}

.invest-availability,
.invest-calculator-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.invest-lang-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.74);
}

.invest-lang-button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 900;
}

.invest-lang-button.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.invest-calculator {
  display: grid;
  gap: 12px;
}

.invest-contact-row {
  margin-top: 12px;
  justify-content: flex-start;
}

.invest-contact-list,
.blog-list {
  display: grid;
  gap: 12px;
}

.invest-contact-item {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.invest-contact-item:first-child {
  border-top: 0;
}

.invest-contact-item span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.blog-hero-card {
  margin-bottom: 14px;
}

.blog-post {
  display: grid;
  gap: 9px;
}

.blog-post time {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.blog-post h2,
.blog-post p {
  margin: 0;
}

.blog-post p {
  color: var(--ink);
  line-height: 1.5;
}

.invest-slider-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.invest-slider-row input {
  min-height: 34px;
  padding: 0;
}

.invest-availability div,
.invest-calculator-result-grid div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.72);
}

.invest-availability span,
.invest-calculator-result-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.invest-availability strong,
.invest-calculator-result-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.invest-action-card,
.invest-copy {
  display: grid;
  gap: 12px;
}

.invest-feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.45;
}

.invest-feature-list li {
  padding-left: 2px;
}

.movie-detail-prompt {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.48;
  white-space: pre-wrap;
}

.movie-title-form {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.movie-url-row {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  max-width: 100%;
  margin-top: 12px;
}

.movie-url-row a {
  min-width: 0;
  max-width: 100%;
  color: var(--accent);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.card > video {
  display: block;
  width: 100%;
  margin-top: 14px;
  border-radius: 18px;
  object-fit: contain;
  background: #101820;
}

.history-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.history-media-block {
  margin-top: 10px;
}

.list-item .history-reply {
  padding: 12px;
  border-radius: 16px;
  background: rgba(31, 111, 91, 0.08);
}

.prompt-box {
  position: relative;
  margin-top: 10px;
  padding: 12px 48px 12px 12px;
  border-radius: 16px;
  background: rgba(17, 24, 20, 0.06);
}

.prompt-box p {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.42;
}

.asset-job-prompt {
  margin: 8px 0 12px;
}

.audio-suggestion-box {
  position: relative;
  min-height: 42px;
  padding: 12px 48px 12px 12px;
  border-radius: 16px;
  background: rgba(17, 24, 20, 0.06);
}

.audio-suggestion-box p {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.42;
}

.timestamp-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(17, 24, 20, 0.12);
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.86);
  color: var(--ink);
  cursor: pointer;
}

.copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.inline-copy-button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(17, 24, 20, 0.12);
  border-radius: 12px;
  background: rgba(255, 252, 244, 0.86);
  color: var(--ink);
  cursor: pointer;
}

.inline-copy-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.inline-delete-button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(142, 46, 46, 0.18);
  border-radius: 12px;
  background: var(--danger);
  color: white;
  cursor: pointer;
}

.inline-delete-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.asset-detail-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.asset-detail-actions > * {
  flex: 0 1 auto;
}

.soundtrack-panel {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(31, 111, 91, 0.08);
}

.soundtrack-panel summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
}

.soundtrack-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.score-prompt-panel {
  display: grid;
  gap: 10px;
}

.score-prompt-panel h3 {
  margin: 0;
  font-size: 1rem;
}

.movie-score-form {
  display: grid;
  gap: 10px;
}

.textarea-copy-wrap {
  position: relative;
}

.textarea-copy-wrap textarea {
  padding-right: 52px;
}

.textarea-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
}

.list-item video,
.list-item img,
.list-item audio {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 12px;
  border-radius: 16px;
  background: #101820;
}

.list-item video,
.list-item img {
  height: auto;
  object-fit: contain;
}

.metric-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(31, 111, 91, 0.14);
  border-radius: 14px;
  background: rgba(31, 111, 91, 0.1);
}

.metric .label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.68rem;
}

.metric strong {
  display: block;
  margin-top: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.account-billing-grid {
  display: grid;
  gap: 14px;
}

.account-current-head {
  display: grid;
  gap: 14px;
}

.account-plan-expiration {
  margin: -6px 0 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.36;
}

.plan-list {
  display: grid;
  gap: 10px;
}

.plan-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 250, 240, 0.76);
}

.plan-option-copy {
  min-width: 0;
}

.plan-option-copy strong {
  display: block;
  line-height: 1.18;
}

.plan-option-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.32;
}

.plan-price {
  display: grid;
  justify-items: end;
  color: var(--accent);
  line-height: 1;
}

.plan-price strong {
  font-size: 1.24rem;
}

.plan-price span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.plan-option .buy-button {
  grid-column: 1 / -1;
  min-height: 40px;
  margin-top: 2px;
}

.current-plan-option {
  border-color: rgba(31, 111, 91, 0.45);
  background: rgba(31, 111, 91, 0.09);
}

.sold-out-plan {
  opacity: 0.72;
}

.payment-list {
  gap: 8px;
}

.payment-item {
  padding: 12px;
}

.button-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.button-row > * {
  flex: 1;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0;
}

.pagination-bar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.pagination-bar select {
  width: auto;
  min-width: 78px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 14px;
}

.pager-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager-buttons .secondary-button.small {
  min-height: 36px;
  padding-inline: 12px;
}

.compact-actions {
  margin-top: 0;
}

.compact-actions > * {
  flex: 0 0 auto;
}

.compact-checkbox {
  min-height: 36px;
  padding: 0 10px;
}

.compact-checkbox input {
  width: 18px;
  min-height: 18px;
}

.compact-form.movie-scene-regenerate-form {
  grid-template-columns: minmax(0, 1fr) minmax(120px, 180px) auto;
  align-items: end;
}

.movie-edit-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.movie-edit-history .current-version {
  border-color: rgba(31, 111, 91, 0.42);
  background: rgba(31, 111, 91, 0.1);
}

.edit-status,
.frame-mode {
  margin: 12px 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(31, 111, 91, 0.08);
}

.edit-status.success {
  background: rgba(31, 111, 91, 0.14);
}

.edit-status.error {
  background: rgba(164, 56, 45, 0.12);
  color: var(--danger);
}

.inline-status {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(31, 111, 91, 0.08);
  color: var(--ink);
  font-weight: 750;
}

.inline-status.success {
  background: rgba(31, 111, 91, 0.14);
}

.inline-status.error {
  background: rgba(164, 56, 45, 0.12);
  color: var(--danger);
}

.panel-busy {
  cursor: progress;
}

.frame-mode-body {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.frame-control-grid {
  display: grid;
  grid-template-columns: 48px 48px minmax(118px, 1fr) 48px 48px;
  gap: 8px;
  align-items: center;
}

.frame-control-grid button,
.frame-number-box {
  min-height: 44px;
}

.frame-control-grid button {
  padding-inline: 0;
  font-size: 1rem;
}

.frame-number-control {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.frame-number-box {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
}

.frame-number-control input {
  flex: 0 1 5ch;
  width: 5ch;
  min-width: 3ch;
  min-height: 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1rem;
  font-weight: 850;
  text-align: center;
}

.frame-number-control input::-webkit-outer-spin-button,
.frame-number-control input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.frame-number-control small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.frame-scene-prefix:empty {
  display: none;
}

.frame-scene-prefix {
  flex: 0 0 auto;
}

.admin-debug-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  margin: 10px 0 12px;
}

.admin-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.admin-plan-form {
  align-items: end;
  margin-top: 12px;
}

.admin-plan-form button {
  align-self: end;
}

.movie-job-item {
  display: grid;
  gap: 12px;
}

.movie-job-item.failed {
  border-color: rgba(164, 56, 45, 0.34);
}

.movie-job-log {
  margin-top: 4px;
}

.movie-job-log-item,
.debug-log-item {
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.movie-job-item .job-dismiss-button {
  justify-self: start;
}

.model-info-list .list-item {
  padding: 12px;
}

.model-info-list code {
  overflow-wrap: anywhere;
}

.debug-log-item pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0 0;
  max-height: 360px;
  overflow: auto;
}

.debug-text-block {
  display: grid;
  gap: 4px;
}

.debug-text-block pre {
  max-height: none;
}

.debug-text-block details pre {
  max-height: 520px;
}

.debug-text-block a {
  color: var(--accent);
  font-weight: 800;
}

.code-box {
  padding: 14px;
  border-radius: 18px;
  background: #101820;
  color: #d9f4df;
  font-family: "Courier New", monospace;
  overflow-wrap: anywhere;
}

.compact-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: 12px 0;
}

.result-card {
  position: sticky;
  bottom: 12px;
  z-index: 12;
  border-color: rgba(31, 111, 91, 0.35);
}

.result-card video,
.result-card img,
.result-card audio {
  width: 100%;
  margin-top: 12px;
  border-radius: 18px;
  background: #101820;
}

.result-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.result-gallery img {
  margin-top: 0;
}

.history-image-gallery {
  margin-top: 10px;
}

.asset-link-list {
  margin: 4px 0 0;
  padding-left: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(31, 111, 91, 0.12);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  width: min(720px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: 18px;
  background: #101820;
  color: white;
  box-shadow: var(--shadow);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 24, 32, 0.68);
}

.confirm-dialog {
  width: min(100%, 420px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fffaf0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.confirm-dialog h2 {
  margin-top: 0;
}

.confirm-dialog ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.confirm-dialog .button-row {
  margin-top: 18px;
}

.confirm-dialog .button-row > * {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}

.confirm-dialog .primary-button,
.confirm-dialog .secondary-button {
  width: auto;
}

@media (max-width: 420px) {
  .confirm-dialog .button-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .confirm-dialog .button-row > * {
    width: 100%;
    min-width: 0;
    padding-inline: 8px;
  }
}

.legal-page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px;
}

.legal-page h1 {
  margin: 0 0 12px;
}

.legal-table {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.legal-table div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(31, 111, 91, 0.08);
}

.legal-table span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .app-shell {
    width: min(100%, 1180px);
    padding-inline: 24px;
  }

  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-billing-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  }

  .account-current-card {
    grid-column: 1 / -1;
  }

  .account-current-head {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
    align-items: center;
  }

  .plan-option {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .plan-option .buy-button {
    grid-column: auto;
    min-width: 92px;
    margin-top: 0;
  }

  .hero-card {
    min-height: 320px;
    align-content: end;
  }
}

@media (max-width: 520px) {
  .app-shell {
    padding-inline: 10px;
  }

  .topbar {
    gap: 6px;
  }

  .topbar h1 {
    font-size: clamp(1.35rem, 7vw, 1.75rem);
  }

  .topbar .eyebrow {
    font-size: 0.6rem;
  }

  .global-language-switch {
    gap: 2px;
    padding: 3px;
  }

  .global-language-button {
    min-width: 27px;
    min-height: 30px;
    padding-inline: 5px;
    font-size: 0.65rem;
  }

  .auth-status-button {
    max-width: 112px;
    min-height: 38px;
    padding-inline: 9px;
    font-size: 0.78rem;
  }

  .auth-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
  }

  .tabbar {
    top: 72px;
    gap: 6px;
    margin-inline: -10px;
    padding: 8px 10px 10px;
  }

  .tab-button {
    flex: 1 1 calc(33.333% - 6px);
    min-width: 0;
    min-height: 40px;
    padding-inline: 7px;
    font-size: clamp(0.72rem, 3vw, 0.88rem);
  }

  .tabbar.admin-mode .tab-button {
    flex-basis: calc(25% - 6px);
  }

  .card {
    border-radius: 24px;
    padding: 15px;
  }

  .grid-2,
  .invest-availability,
  .invest-calculator-result-grid,
  .compact-form,
  .entity-toolbar,
  .auth-button-grid {
    grid-template-columns: 1fr;
  }

  .compact-form.movie-scene-regenerate-form {
    grid-template-columns: 1fr;
  }

  .entity-card {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
  }

  .entity-card-image {
    width: 54px;
    border-radius: 12px;
  }

  .invest-hero-head {
    display: grid;
  }

  .pagination-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head {
    align-items: flex-start;
  }

  .section-head > .button-row {
    justify-content: flex-start;
    width: 100%;
  }

  .pager-buttons {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .status-strip > div {
    min-width: 0;
    min-height: 58px;
    padding: 8px;
    border-radius: 16px;
  }

  .label {
    margin-bottom: 5px;
    font-size: 0.62rem;
  }

  .status-strip strong {
    font-size: 0.86rem;
    line-height: 1.16;
    white-space: normal;
  }

  .frame-control-grid {
    grid-template-columns: 34px 34px minmax(124px, 1fr) 34px 34px;
    gap: 5px;
  }

  .frame-control-grid button,
  .frame-number-box {
    min-height: 40px;
  }

  .frame-number-label {
    display: none;
  }

  .frame-number-control small {
    font-size: 0.52rem;
  }

  .frame-number-control input {
    width: 4.6ch;
    font-size: 0.86rem;
  }

  .admin-debug-controls {
    grid-template-columns: 1fr;
  }

  .admin-count-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-count-row .secondary-button.small {
    min-width: 0;
    padding-inline: 8px;
  }
}

@media (orientation: landscape) {
  .login-auth-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: center;
    width: min(100%, 864px);
  }

  .login-auth-options .auth-provider-button {
    gap: 8px;
    padding-inline: 8px;
    font-size: 0.84rem;
  }

  .login-auth-options .provider-icon {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 330px) {
  .login-auth-options .auth-provider-button {
    gap: 7px;
    padding-inline: 8px;
    font-size: 0.84rem;
  }

  .login-auth-options .provider-icon {
    width: 20px;
    height: 20px;
  }
}
