:root {
  --bg1: #1d1f1f;
  --bg2: #15191a;
  --fg: #f1eae2;
  --fg-muted: rgba(221, 230, 221, 0.75);
  --fg-subtle: rgba(221, 230, 221, 0.55);
  --glass-bg: rgba(40, 42, 42, 0.92);
  --glass-border: rgba(221, 230, 221, 0.08);
  --glass-radius: 12px;
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.24);

  --brand: #d38a59;
  --brand-soft: rgba(211, 138, 89, 0.18);
  --accent: #e3b681;
  --warn: #f0c36f;

  --page-padding: clamp(14px, 1.8vw, 28px);
  --section-gap: clamp(14px, 2vw, 28px);
  --card-gap: clamp(12px, 1.4vw, 20px);
  --pane-padding: clamp(14px, 1.4vw, 22px);
  --grid-gap: clamp(10px, 1vw, 16px);

  --font-title: clamp(17px, 1.3vw, 22px);
  --font-h2: clamp(13px, 1vw, 16px);
  --font-body: clamp(13px, 0.9vw, 15px);
  --font-small: clamp(11px, 0.78vw, 13px);
}

/* Visually hidden but accessible text holder (for i18n targets we removed from UI) */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  background-color: #1d1f1f;
}

body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: var(--font-body);
  background:
    radial-gradient(1400px 720px at 10% -15%, rgba(211, 138, 89, 0.1), transparent 65%),
    radial-gradient(980px 520px at 90% -5%, rgba(243, 223, 204, 0.06), transparent 65%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  line-height: 1.55;
}

.page {
  padding: var(--page-padding);
  padding-top: calc(var(--page-padding) + 10px);
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.5vh, 2px);
  min-width: 0;
}

.glass {
  background: var(--glass-bg);
  border: none;
  border-radius: var(--glass-radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(14px) saturate(1.35);
}

.debug-warning {
  position: fixed;
  top: 0;
  inset-inline: 0;
  text-align: center;
  padding-block: 10px;
  font-size: var(--font-small);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #0b0f14;
  background: linear-gradient(120deg, #ffb067 0%, #ff6b6b 100%);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(8px, 1vh, 12px) clamp(12px, 1.6vw, 22px);
  background: transparent;
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 18px);
}

.model-inline {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 16px);
  margin-left: clamp(10px, 2vw, 24px);
  flex-wrap: wrap;
}

.model-inline .label {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.brand-tagline {
  font-size: clamp(16px, 2.1vw, 22px);
  font-weight: 500;
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.logo {
  width: clamp(30px, 4vw, 36px);
  height: clamp(30px, 4vw, 36px);
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}

.logo img {
  width: 100%;
  height: 100%;
}

.logo-link {
  text-decoration: none;
  color: inherit;
}

.title {
  font-size: clamp(18px, 2.4vw, 24px);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.5vw, 18px);
}

.user-info {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 12px);
  min-width: 0;
}

.user-avatar,
#userAvatar {
  width: clamp(32px, 4vw, 40px);
  height: clamp(32px, 4vw, 40px);
  border-radius: 50%;
  flex-shrink: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg-muted);
  cursor: default;
  pointer-events: none;
}

.user-avatar i {
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1;
}

.user-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(211, 138, 89, 0.18);
}

.user-info .user-name {
  font-size: clamp(13px, 1.5vw, 14px);
  font-weight: 600;
  color: var(--fg-muted);
  max-width: clamp(120px, 20vw, 240px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entitlement-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.entitlement-badge[data-plan="plus"] {
  border-color: rgba(255, 184, 77, 0.35);
  color: #ffd28a;
  background: rgba(255, 184, 77, 0.1);
}

.entitlement-badge #planState {
  font-weight: 700;
}

.entitlement-badge #quotaState {
  color: inherit;
  opacity: 0.82;
}

.entitlement-badge #syncState {
  color: inherit;
  opacity: 0.62;
}

.user-info.signed-in .user-name {
  color: var(--fg);
}

.user-info.signed-in .user-avatar {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.14);
}

#logoutIcon {
  display: none;
  font-size: clamp(14px, 1.6vw, 16px);
}

#loginBtn.icon-only {
  width: clamp(32px, 3.2vw, 38px);
  height: clamp(32px, 3.2vw, 38px);
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

#loginBtn.icon-only:hover {
  background: transparent;
  transform: none;
}

#loginBtn.icon-only #logoutIcon {
  display: inline-block;
}

#loginBtn.icon-only #i18n-login {
  display: none;
}

/* Topbar minimal look for login/logout and language icon */
.topbar .actions #loginBtn:not(.icon-only) {
  background: transparent !important;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.topbar .actions #loginBtn:not(.icon-only):hover {
  background: transparent !important;
  transform: none;
}

.topbar .actions #loginBtn.btn.primary {
  background: transparent !important;
  color: var(--fg);
}

body.modal-open {
  overflow: hidden;
}

body.app-auth-required.app-auth-checking,
body.app-auth-required.app-auth-locked {
  overflow: hidden;
}

body.app-auth-required.app-auth-checking #app,
body.app-auth-required.app-auth-locked #app {
  max-height: 100vh;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  user-select: none;
}

body.app-auth-required.app-auth-checking::after {
  content: "Checking sign-in...";
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 1500;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-muted);
  background: rgba(7, 12, 17, 0.78);
  box-shadow: var(--shadow-md);
}

body.app-auth-required.app-auth-locked .auth-close {
  display: none;
}

body.app-auth-required.app-auth-locked .auth-backdrop {
  background: rgba(6, 10, 18, 0.82);
  backdrop-filter: blur(14px);
}

/* Language select shows globe icon only; keep select for accessibility */
.lang-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 3.2vw, 38px);
  height: clamp(32px, 3.2vw, 38px);
  background: var(--glass-bg);
  border-radius: var(--glass-radius);
  backdrop-filter: blur(14px) saturate(1.35);
  box-shadow: var(--shadow-sm);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.lang-trigger i {
  font-size: clamp(14px, 1.6vw, 16px);
  color: var(--fg);
  pointer-events: none;
}

.lang-trigger select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  appearance: none;
  cursor: pointer;
}

.lang-trigger select:focus {
  outline: none;
}

.lang-trigger:hover {
  background: rgba(17, 25, 40, 0.6);
  box-shadow: var(--shadow-md);
}

.lang-trigger select:focus+i,
.lang-trigger:hover i {
  color: var(--brand);
}

#userAvatar {
  display: inline-block;
  object-fit: cover;
  cursor: pointer;
  border: none;
}

#userAvatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 4px rgba(211, 138, 89, 0.18);
}

select {
  appearance: none;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg);
  border: none;
  border-radius: 999px;
  padding: 0.5em 1.75em 0.5em 1em;
  font-size: var(--font-small);
  line-height: 1.4;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

select:focus {
  outline: none;
  background: rgba(211, 138, 89, 0.14);
  box-shadow: 0 0 0 6px rgba(211, 138, 89, 0.14);
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.5em 1.05em;
  font-size: clamp(11px, 0.78vw, 12px);
  font-weight: 600;
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #071625;
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(211, 138, 89, 0.85), rgba(227, 182, 129, 0.85));
}

.btn.small {
  padding: 0.42em 0.95em;
}

.btn.xsmall {
  padding: 0.3em 0.72em;
}

/* Ensure media controls never wrap text inside a button or labels */
.btn span,
.switch-label,
.count {
  white-space: nowrap;
}

/* Auth modal */
.auth-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vh, 72px);
  z-index: 1600;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.65);
  backdrop-filter: blur(12px);
}

.auth-panel {
  position: relative;
  width: min(620px, 94vw);
  padding: clamp(24px, 6vh, 44px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  min-height: clamp(460px, 68vh, 620px);
}

.auth-close {
  position: absolute;
  top: clamp(12px, 2vh, 18px);
  inset-inline-end: clamp(12px, 2vh, 18px);
  display: grid;
  place-items: center;
  width: clamp(32px, 3.5vw, 40px);
  height: clamp(32px, 3.5vw, 40px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-size: clamp(14px, 1.8vw, 18px);
  cursor: pointer;
}

.auth-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.auth-head {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 28px);
}

.auth-logo {
  width: clamp(48px, 6.2vw, 68px);
  height: clamp(48px, 6.2vw, 68px);
  border-radius: clamp(12px, 1.5vw, 16px);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: clamp(6px, 1vw, 10px);
}

.auth-head-text h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  letter-spacing: 0.04em;
}

.auth-head-text p {
  margin: clamp(4px, 0.8vh, 6px) 0 0;
  font-size: clamp(12px, 1.6vw, 15px);
  color: var(--fg-subtle);
  line-height: 1.6;
}

.auth-tabs {
  display: inline-flex;
  padding: clamp(4px, 0.8vh, 6px);
  border-radius: clamp(18px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.06);
  gap: clamp(6px, 1vw, 10px);
  align-self: center;
}

.auth-tabs button {
  border: none;
  border-radius: clamp(14px, 2.4vw, 24px);
  padding: clamp(6px, 1.2vh, 10px) clamp(18px, 4vw, 34px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg-subtle);
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-tabs button.active {
  background: linear-gradient(135deg, rgba(211, 138, 89, 0.24), rgba(227, 182, 129, 0.28));
  color: var(--fg);
}

.auth-alert {
  padding: clamp(10px, 1.6vh, 14px) clamp(12px, 2vw, 18px);
  border-radius: clamp(10px, 1.8vw, 14px);
  font-size: clamp(12px, 1.6vw, 14px);
  line-height: 1.5;
}

.auth-alert.error {
  background: rgba(255, 99, 132, 0.12);
  color: #ffb4c1;
}

.auth-alert.success {
  background: rgba(211, 138, 89, 0.12);
  color: #f3dfcc;
}

/* Confirm Modal Styles */
.confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vh, 72px);
  z-index: 1700;
}

.confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 18, 0.65);
  backdrop-filter: blur(12px);
}

.confirm-panel {
  position: relative;
  width: min(420px, 90vw);
  padding: clamp(24px, 4vh, 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3vh, 28px);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  text-align: center;
}

.confirm-close {
  position: absolute;
  top: clamp(12px, 2vh, 18px);
  inset-inline-end: clamp(12px, 2vh, 18px);
  display: grid;
  place-items: center;
  width: clamp(32px, 3.5vw, 40px);
  height: clamp(32px, 3.5vw, 40px);
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  font-size: clamp(14px, 1.8vw, 18px);
  cursor: pointer;
  transition: background 0.2s ease;
}

.confirm-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.confirm-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2.5vh, 24px);
  width: 100%;
}

.confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(64px, 8vw, 80px);
  height: clamp(64px, 8vw, 80px);
  border-radius: 50%;
  background: rgba(255, 207, 102, 0.15);
  color: #ffcf66;
  font-size: clamp(24px, 3.5vw, 32px);
}

.confirm-title {
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 600;
  color: var(--fg);
  margin: 0;
}

.confirm-message {
  font-size: var(--font-body);
  color: var(--fg-muted);
  margin: 0;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  gap: clamp(12px, 2vw, 16px);
  justify-content: center;
  width: 100%;
}

.auth-social {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: clamp(10px, 1.8vh, 16px);
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 1.6vw, 14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(14px, 2vw, 20px);
  padding: clamp(10px, 1.8vh, 14px) clamp(16px, 3vw, 24px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.auth-social-btn .icon {
  display: grid;
  place-items: center;
  width: clamp(26px, 3.6vw, 32px);
  height: clamp(26px, 3.6vw, 32px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.auth-social-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
}

.auth-divider {
  position: relative;
  text-align: center;
  color: var(--fg-subtle);
  font-size: clamp(12px, 1.6vw, 14px);
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.auth-divider::before {
  inset-inline-start: 0;
}

.auth-divider::after {
  inset-inline-end: 0;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vh, 10px);
}

.auth-field label {
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(12px, 2vw, 16px);
  padding: clamp(10px, 1.8vh, 14px) clamp(14px, 2.6vw, 20px);
  font-size: clamp(13px, 1.8vw, 16px);
  color: var(--fg);
  background: rgba(7, 12, 17, 0.45);
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(211, 138, 89, 0.65);
  box-shadow: 0 0 0 2px rgba(211, 138, 89, 0.18);
}

.auth-password {
  display: flex;
  align-items: center;
  border-radius: clamp(12px, 2vw, 16px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 12, 17, 0.45);
}

.auth-password input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.auth-password button {
  width: clamp(40px, 5vw, 48px);
  height: 100%;
  border: none;
  background: transparent;
  color: var(--fg-subtle);
  font-size: clamp(16px, 2.4vw, 20px);
  cursor: pointer;
}

.auth-password button:hover {
  color: var(--fg);
}

.auth-aux {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 18px);
  font-size: clamp(12px, 1.6vw, 14px);
  margin-bottom: clamp(16px, 3vh, 32px);
}

.auth-checkbox {
  display: inline-flex;
  align-items: center;
  gap: clamp(8px, 1.6vw, 12px);
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-checkbox input {
  width: clamp(16px, 2vw, 18px);
  height: clamp(16px, 2vw, 18px);
  accent-color: var(--accent);
}

.auth-agree {
  align-items: flex-start;
  line-height: 1.6;
}

.auth-inline-link,
.auth-link {
  background: none;
  border: none;
  color: var(--brand);
  font-size: inherit;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}

.auth-inline-link:hover,
.auth-link:hover {
  color: var(--fg);
  text-decoration: underline;
}

#authForm {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vh, 28px);
  flex: 1;
}

.auth-submit {
  width: clamp(100px, 32vw, 160px);
  align-self: center;
  justify-content: center;
  font-size: clamp(13px, 1.9vw, 17px);
  padding-block: clamp(12px, 2vh, 16px);
  gap: clamp(8px, 1.4vw, 12px);
  margin-inline: auto;
  margin-top: auto;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 12px);
  font-size: clamp(12px, 1.6vw, 14px);
  color: var(--fg-muted);
}

.auth-spinner {
  width: clamp(16px, 2.2vw, 20px);
  height: clamp(16px, 2.2vw, 20px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: auth-spin 0.9s linear infinite;
}

@keyframes auth-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .auth-panel {
    width: min(520px, 96vw);
    padding: clamp(18px, 6vh, 32px);
  }

  .auth-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-social {
    grid-template-columns: 1fr;
  }

  .auth-divider::before,
  .auth-divider::after {
    width: 27%;
  }

  .topbar {
    flex-wrap: wrap;
    justify-content: center;
    gap: clamp(12px, 3vh, 20px);
  }

  .brand {
    flex-wrap: wrap;
    gap: clamp(8px, 2vw, 12px);
    flex: 1 0 100%;
    justify-content: center;
  }

  .model-inline {
    margin-left: 0;
    margin-top: clamp(4px, 1vh, 8px);
    width: 100%;
    justify-content: center;
  }

  .models {
    justify-content: center;
  }

  .actions {
    gap: clamp(12px, 3vw, 16px);
  }
}

.hero {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-top: clamp(12px, 2vh, 20px);
}

.hero h1 {
  margin: 0 0 5px;
  font-size: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero-sub {
  color: var(--fg-muted);
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.6;
  max-width: min(60ch, 70%);
}

.controls {
  padding: clamp(0px, 0.4vh, 2px) clamp(4px, 1.2vw, 8px);
  display: flex;
  flex-direction: column;
  gap: clamp(0px, 0.4vh, 2px);
}

.model-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
}

.model-picker .label {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.models {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.45em 1.1em;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  color: var(--fg-muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.chip input {
  appearance: none;
  width: 0;
  height: 0;
  position: absolute;
  opacity: 0;
}

.chip span {
  position: relative;
  z-index: 1;
  font-size: var(--font-small);
  font-weight: 500;
}

.chip::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover::before {
  background: rgba(211, 138, 89, 0.08);
}

.chip input:checked+span {
  color: #071625;
}

.chip input:checked+span::before {
  content: "";
  position: absolute;
  inset: -0.45em -1.1em;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  z-index: -1;
  box-shadow: 0 10px 20px rgba(211, 138, 89, 0.32);
}

.chip input:checked~span::before {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.chip input:checked~span {
  color: #071625;
}

.warning {
  padding: clamp(14px, 2vh, 18px);
  border-radius: calc(var(--glass-radius) - 6px);
  background: rgba(255, 207, 102, 0.12);
  color: #ffe6ad;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warning-title {
  font-weight: 600;
  color: var(--warn);
  display: flex;
  align-items: center;
  gap: 6px;
}

.warning-body {
  font-size: var(--font-small);
  line-height: 1.6;
}

.ignore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-small);
  color: rgba(255, 230, 173, 0.75);
}

.hidden {
  display: none !important;
}

.split {
  display: grid;
  gap: var(--card-gap);
  grid-template-columns: minmax(210px, 0.72fr) minmax(360px, 1.35fr) minmax(420px, 1.55fr);
  align-items: stretch;
  min-width: 0;
}

@media (max-width: 1440px) {
  .split {
    grid-template-columns: minmax(190px, 0.68fr) minmax(320px, 1.25fr) minmax(380px, 1.45fr);
  }
}

@media (max-width: 1120px) {
  .split {
    grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.2fr);
  }

  .split .meta {
    grid-column: span 2;
  }
}

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

  .split .camera,
  .split .meta {
    grid-column: auto;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }
}

.pane {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.4vh, 18px);
  padding: var(--pane-padding);
  min-height: clamp(420px, 62vh, 660px);
  min-width: 0;
}

.pane.camera {
  grid-column: 1 / -1;
  min-height: 0;
  max-height: clamp(180px, 28vh, 320px);
}

.pane.side {
  gap: clamp(16px, 2.2vh, 24px);
}

.pane.side .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--glass-radius) - 4px);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.pane.side .panel+.panel {
  margin-top: clamp(10px, 1.2vh, 14px);
}

.pane.side .tpl-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  padding: clamp(10px, 1.2vh, 14px);
}

.pane.side .table-wrap {
  flex: 1 1 auto;
  overflow: auto;
  max-height: 100%;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  padding: clamp(10px, 1.2vh, 14px);
  gap: clamp(6px, 0.8vw, 10px);
}

.pane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 1.6vw, 18px);
}

.pane.assets .pane-title {
  justify-content: flex-end;
}

.pane-title>span {
  font-size: var(--font-h2);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pane-title .right-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(6px, 0.75vw, 10px);
}

.count {
  font-size: var(--font-small);
  color: var(--fg-subtle);
  padding: 0.25em 0.75em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.switch {
  position: relative;
  display: inline-block;
  width: clamp(40px, 5vw, 48px);
  height: clamp(20px, 2.6vh, 24px);
}

.switch input {
  display: none;
}

.slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.slider::before {
  content: "";
  position: absolute;
  width: clamp(14px, 2.4vh, 18px);
  height: clamp(14px, 2.4vh, 18px);
  border-radius: 50%;
  background: #fff;
  top: 50%;
  left: clamp(3px, 0.5vw, 4px);
  transform: translate(0, -50%);
  transition: transform 0.2s ease;
  box-shadow: 0 6px 10px rgba(8, 16, 27, 0.3);
}

.switch input:checked+.slider {
  background: linear-gradient(135deg, var(--brand), var(--accent));
}

.switch input:checked+.slider::before {
  transform: translate(calc(130% - clamp(0em, 0%, 0%) * 2), -50%);
}

.switch-label {
  font-size: var(--font-small);
  color: var(--fg-muted);
}

.pane.assets {
  position: relative;
  overflow: hidden;
}

.dropzone {
  position: absolute;
  inset: clamp(4px, 0.8vh, 8px);
  border-radius: calc(var(--glass-radius) - 8px);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--fg-muted);
  pointer-events: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.dropzone.dragover {
  background: rgba(211, 138, 89, 0.12);
  box-shadow: 0 0 0 8px rgba(211, 138, 89, 0.08);
}


.grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(104px, 138px);
  height: clamp(360px, 56vh, 560px);
  overflow: auto;
  margin-top: clamp(8px, 1vh, 12px);
}

.loading {
  position: absolute;
  inset: clamp(10px, 1.6vh, 14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  background: rgba(7, 12, 17, 0.55);
  border-radius: calc(var(--glass-radius) - 6px);
}

.spinner {
  width: clamp(36px, 5vw, 44px);
  height: clamp(36px, 5vw, 44px);
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card img {
  width: 100%;
  height: clamp(104px, 10vw, 138px);
  object-fit: cover;
  display: block;
}

.card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 32px rgba(6, 11, 21, 0.45);
}

.card .thumb {
  width: 100%;
  height: clamp(104px, 10vw, 138px);
  object-fit: cover;
  background: rgba(0, 0, 0, 0.4);
}

.card .meta {
  position: absolute;
  inset-inline: clamp(8px, 1.4vw, 12px);
  bottom: clamp(8px, 1.2vh, 12px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 1vw, 8px);
  font-size: var(--font-small);
  color: rgba(255, 255, 255, 0.9);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-red {
  background: #ff4757;
  box-shadow: 0 0 8px rgba(255, 71, 87, 0.5);
}

.status-yellow {
  background: #ffa502;
  box-shadow: 0 0 8px rgba(255, 165, 2, 0.5);
}

.status-green {
  background: #2ed573;
  box-shadow: 0 0 8px rgba(46, 213, 115, 0.5);
}

/* Placeholder styles */
.card.placeholder {
  opacity: 0.6;
  cursor: default;
}

.card.placeholder .thumb {
  background: rgba(255, 255, 255, 0.002);
  /* 占位图颜色 */
}

.badge {
  background: rgba(7, 12, 17, 0.4);
  padding: 0.25em 0.75em;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.card.selected {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(8px, 1vw, 12px);
}

.toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(7px, 0.75vw, 10px);
}

.toolbar .tokens {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-small);
  color: var(--fg-muted);
  white-space: nowrap;
}

.progress .bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

#progressBar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.progress .info {
  color: var(--fg-muted);
  font-size: var(--font-small);
  margin-top: 6px;
  min-height: 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.3vh, 16px);
  margin-top: clamp(8px, 1vh, 12px);
}

.form label,
.platform-section label {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 0.8vh, 10px);
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1vw, 12px);
}

.field-head span {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.inline-actions {
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 10px);
}

.form input,
.form textarea,
.form select,
.platform-section input,
.platform-section textarea,
.platform-section select {
  background: rgba(255, 255, 255, 0.04);
  border: none;
  border-radius: 12px;
  color: var(--fg);
  padding: 0.62em 0.85em;
  font-size: clamp(13px, 0.9vw, 15px);
  box-shadow: 0 0 0 0 rgba(211, 138, 89, 0);
  transition: box-shadow 0.2s ease, background 0.2s ease;
}

.form input:focus,
.form textarea:focus,
.form select:focus,
.platform-section input:focus,
.platform-section textarea:focus,
.platform-section select:focus {
  outline: none;
  background: rgba(211, 138, 89, 0.12);
  box-shadow: 0 0 0 4px rgba(211, 138, 89, 0.15);
}

.platform-section {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vh, 14px);
  margin-top: clamp(10px, 1.2vh, 14px);
  margin-bottom: clamp(8px, 1vh, 12px);
  padding-top: clamp(12px, 1.4vh, 16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.csv-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.7vw, 9px);
}

.csv-template-tab {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  padding: 0.45em 0.82em;
  color: var(--fg-muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: clamp(11px, 0.75vw, 12px);
  font-weight: 650;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.csv-template-tab:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}

.csv-template-tab.active {
  color: #061018;
  background: linear-gradient(135deg, rgba(211, 138, 89, 0.92), rgba(227, 182, 129, 0.86));
  box-shadow: 0 12px 28px rgba(211, 138, 89, 0.28);
}

.platform-fields {
  display: flex;
  flex-direction: column;
  gap: clamp(9px, 1vh, 13px);
}

.template-fields {
  display: flex;
  flex-direction: column;
  gap: clamp(9px, 1vh, 13px);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1vw, 12px);
}

.platform-grid label,
.field-full {
  min-width: 0;
}

.platform-grid span,
.check-grid span {
  color: var(--fg-subtle);
  font-size: clamp(10px, 0.7vw, 11px);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1vw, 12px);
}

.check-grid label {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 0.45em 0.7em;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.check-grid input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  flex: 0 0 auto;
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(6px, 0.7vw, 10px);
  align-content: flex-start;
  align-items: flex-start;
  min-height: clamp(120px, 20vh, 220px);
  max-height: clamp(160px, 28vh, 280px);
  overflow-y: auto;
  padding: clamp(10px, 1.2vw, 16px);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.tagchip {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 0.8vw, 10px);
  padding: clamp(10px, 1.5vh, 14px) clamp(16px, 2.2vw, 22px);
  border-radius: 999px;
  background: rgba(227, 182, 129, 0.85);
  color: #071625;
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  flex: 0 0 auto;
  min-height: clamp(34px, 4.4vh, 46px);
  max-width: clamp(160px, 24vw, 240px);
  overflow-wrap: anywhere;
}

.chip-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #071625;
  color: rgba(227, 182, 129, 0.85);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip-close:hover {
  background: #ff0000;
  color: #fff;
}

.export {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.2vw, 14px);
  flex-wrap: wrap;
  color: var(--fg-muted);
}

.tokens strong {
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  color: var(--fg);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(12px, 1.8vh, 16px) clamp(14px, 2vw, 20px);
  background: transparent;
  flex-shrink: 0;
}

.panel-title {
  font-size: clamp(15px, 2vw, 18px);
  font-weight: 600;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 12px);
}

#histDateFilter {
  background: transparent;
  border-radius: 0;
  padding: 0.25em 0.5em;
}

#histDateFilter:focus {
  background: transparent;
  box-shadow: none;
}

.tpl-card {
  border-radius: 14px;
  padding: clamp(12px, 1.6vh, 16px);
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.tpl-card:hover {
  transform: translateY(-2px);
  background: rgba(211, 138, 89, 0.12);
}

.tpl-title {
  font-weight: 600;
  font-size: clamp(15px, 1.9vw, 17px);
}

.tpl-desc {
  color: var(--fg-subtle);
  font-size: var(--font-small);
  line-height: 1.6;
}

.table-wrap {
  border-radius: 0 0 calc(var(--glass-radius) - 6px) calc(var(--glass-radius) - 6px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: clamp(11px, 1.1vw, 13px);
}

thead tr {
  background: rgba(255, 255, 255, 0.01);
}

th,
td {
  padding: clamp(5px, 0.8vh, 8px) clamp(10px, 1.5vw, 15px);
  text-align: left;
}

tbody tr:hover {
  background: rgba(211, 138, 89, 0.05);
}

tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

td .row-actions {
  display: flex;
  gap: clamp(6px, 0.8vw, 10px);
}

/* Camera Info Panel */
.pane.camera {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

.camera-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: clamp(8px, 1.4vh, 14px);
  padding-bottom: clamp(8px, 1.4vh, 14px);
  scrollbar-width: thin;
  scrollbar-color: rgba(211, 138, 89, 0.3) transparent;
  height: 100%;
  box-sizing: border-box;
}

.camera-content::-webkit-scrollbar {
  width: 6px;
}

.camera-content::-webkit-scrollbar-track {
  background: transparent;
}

.camera-content::-webkit-scrollbar-thumb {
  background: rgba(211, 138, 89, 0.3);
  border-radius: 3px;
}

.camera-content::-webkit-scrollbar-thumb:hover {
  background: rgba(211, 138, 89, 0.5);
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
}

.no-exif-notice {
  padding: clamp(8px, 1.2vh, 12px) clamp(10px, 1.6vw, 16px);
  text-align: center;
  color: var(--warn);
  font-size: clamp(11px, 1.1vw, 12px);
}

.no-exif-notice p {
  margin: 0;
  font-weight: 500;
}


.camera-info-item {
  display: flex;
  flex-direction: column;
  gap: clamp(2px, 0.3vh, 3px);
  padding: clamp(5px, 0.7vh, 7px) clamp(8px, 1.2vw, 10px);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: clamp(4px, 0.6vh, 6px);
  transition: background 0.2s ease;
}

.camera-info-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.camera-info-label {
  font-size: var(--font-small);
  font-weight: 600;
  color: var(--fg-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.camera-info-value {
  font-size: clamp(12px, 1.4vw, 14px);
  font-weight: 500;
  color: var(--fg);
  word-break: break-word;
}

.camera-info-highlight {
  padding: clamp(6px, 0.8vh, 8px) clamp(10px, 1.4vw, 12px);
}

.camera-info-highlight .camera-info-label {
  color: var(--brand);
}

.camera-info-highlight .camera-info-value {
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 600;
}

.camera-section-title {
  font-size: clamp(11px, 1.1vw, 12px);
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: clamp(8px, 1.2vh, 12px) 0 clamp(6px, 0.8vh, 8px) 0;
  padding-bottom: clamp(4px, 0.5vh, 5px);
}

.camera-section-title:first-child {
  margin-top: 0;
}

.footer {
  margin-top: auto;
  text-align: center;
  color: var(--fg-subtle);
  font-size: var(--font-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Fotometa visual system refresh, 2026-05-17 */
:root,
html[data-theme="dark"] {
  --bg1: #1d1f1f;
  --bg2: #15191a;
  --page-bg: linear-gradient(180deg, #1d1f1f 0%, #1a1d1d 42%, #15191a 100%);
  --surface: rgba(40, 42, 42, 0.92);
  --surface-strong: rgba(46, 48, 48, 0.96);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(221, 230, 221, 0.08);
  --line-strong: rgba(221, 230, 221, 0.14);
  --fg: #f1eae2;
  --fg-muted: rgba(221, 230, 221, 0.74);
  --fg-subtle: rgba(221, 230, 221, 0.5);
  --brand: #d38a59;
  --brand-strong: #d38a59;
  --brand-soft: rgba(211, 138, 89, 0.22);
  --accent: #e3b681;
  --warm: rgba(211, 138, 89, 0.16);
  --input-bg: rgba(29, 31, 31, 0.84);
  --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 28px 80px rgba(0, 0, 0, 0.38);
  --glass-bg: var(--surface);
  --glass-radius: 12px;
  --font-title: clamp(18px, 1.35vw, 24px);
  --font-h2: 13px;
  --font-body: 14px;
  --font-small: 12px;
  color-scheme: dark;
}


html,
body {
  min-height: 100%;
  background: var(--bg1);
}

body {
  color: var(--fg);
  background: var(--page-bg);
  font-size: var(--font-body);
  letter-spacing: 0;
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  padding: 0;
  gap: 0;
}

.hidden {
  display: none !important;
}

.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(22px) saturate(1.2);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: clamp(78px, 8vw, 94px);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: clamp(12px, 1.6vw, 18px) clamp(18px, 2.4vw, 30px) clamp(22px, 3vw, 34px);
  border-bottom: 0;
  background:
    linear-gradient(180deg, #000 0%, #000 18%, rgba(0, 0, 0, 0.72) 62%, rgba(0, 0, 0, 0) 100%);
  box-shadow: none;
  -webkit-backdrop-filter: blur(14px) saturate(1.18);
  backdrop-filter: blur(14px) saturate(1.18);
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 14% 30%, rgba(211, 138, 89, 0.2), transparent 28rem),
    radial-gradient(ellipse at 72% 20%, rgba(211, 138, 89, 0.2), transparent 30rem),
    linear-gradient(180deg, rgba(8, 11, 17, 0.42), rgba(8, 11, 17, 0));
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.92) 46%, rgba(0, 0, 0, 0) 94%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.92) 46%, rgba(0, 0, 0, 0) 94%);
}



.brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff932f, #ff642f);
  box-shadow: 0 10px 24px rgba(255, 116, 44, 0.22);
}

.logo img {
  display: block;
  object-fit: cover;
}

.title {
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -0.01em;
}

.model-inline {
  margin-left: clamp(22px, 4vw, 60px);
  flex: 0 1 auto;
  gap: 20px;
}

.model-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.model-select-wrap::after {
  content: "\f078";
  position: absolute;
  right: 13px;
  color: var(--fg-muted);
  font-family: "Font Awesome 6 Free";
  font-size: 10px;
  font-weight: 900;
  pointer-events: none;
}

#modelSelect {
  min-height: 38px;
  min-width: 142px;
  padding: 0 34px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--fg);
  background: var(--surface-soft);
  box-shadow: none;
  appearance: none;
  font-size: 13px;
  font-weight: 760;
}

#modelSelect:focus {
  outline: none;
  border-color: rgba(211, 138, 89, 0.7);
  box-shadow: 0 0 0 4px rgba(211, 138, 89, 0.12);
}

.model-inline .label {
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);
}

.models {
  display: inline-flex;
  align-items: center;
  gap: clamp(16px, 3.2vw, 46px);
  padding: 0;
  background: transparent;
}

.chip {
  position: relative;
  padding: 0;
  min-width: 0;
}

.chip::before {
  display: none;
}

.chip span {
  min-height: 36px;
  padding: 10px 18px;
  border-radius: 9px;
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.01em;
  background: transparent;
  border: 1px solid transparent;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chip input:checked+span {
  color: #fff;
  background: linear-gradient(135deg, #c8744e, #d38a59);
  box-shadow: 0 12px 34px rgba(211, 138, 89, 0.34);
}


.chip input:checked+span::before,
.chip input:checked~span::before {
  display: none;
}

.actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-csv-tabs {
  flex: 0 1 auto;
  max-width: min(45vw, 540px);
  margin: 0 4px 0 0;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-csv-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-csv-tabs .csv-template-tab {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.topbar .actions #loginBtn,
.topbar .actions #loginBtn.btn.primary {
  color: var(--fg);
  background: transparent !important;
  border: none;
  box-shadow: none;
  padding: 0 4px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 760;
}

.topbar .actions #loginBtn:hover {
  transform: none;
  color: var(--accent);
}

.lang-trigger {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg);
  background: var(--surface-soft);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.lang-trigger:hover {
  color: var(--accent);
  transform: none;
  background: var(--surface-strong);
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 296px) minmax(420px, 1fr) minmax(420px, 1fr);
  gap: 14px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 22px 16px;
  align-items: stretch;
}

.pane {
  min-width: 0;
  padding: 18px 28px 24px;
  border-radius: 12px;
}

.pane.meta {
  padding-top: 12px;
}

.pane.side {
  margin-left: -22px;
  padding: 18px 24px 28px;
  border-radius: 0;
  border-top: 0;
  border-bottom: 0;
  border-left: 0;
  border-color: var(--line);
  box-shadow: none;
  background: rgba(10, 14, 20, 0.42);
}


.pane.side .panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.pane.side .panel+.panel {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.section-label,
.field-head,
.camera-section-title {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.045em;
  text-transform: none;
}

.pane.side .section-label,
.camera .section-label {
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tpl-grid,
.pane.side .tpl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0;
  overflow: visible;
}

.tpl-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 12px;
  min-height: 80px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.tpl-card:hover,
.tpl-card.active {
  transform: none;
  background: var(--surface-soft);
  border-color: var(--line);
}


.tpl-icon,
.feature-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #e3b681;
  background: rgba(211, 138, 89, 0.2);
}


.tpl-title {
  display: block;
  margin-top: 1px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.25;
}

.tpl-desc {
  display: block;
  margin-top: 7px;
  color: var(--fg-muted);
  font-size: 12.5px;
  font-weight: 560;
  line-height: 1.65;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.panel-head {
  gap: 12px;
  margin-bottom: 16px;
}

.panel-title {
  font-size: 14px;
  font-weight: 820;
}

.panel-actions {
  gap: 8px;
}

.mini,
.panel-actions .mini {
  max-width: 82px;
  min-height: 34px;
  padding: 0 22px 0 10px;
  border-radius: 8px;
  color: var(--fg-muted);
  background: transparent;
}

.history-list {
  display: grid;
  gap: 8px;
}

.templates-panel {
  flex: 0 0 auto !important;
  display: grid !important;
  gap: 10px;
}

.history-panel {
  flex: 0 0 auto !important;
  min-height: 0;
  max-height: 260px;
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}

.history-panel .history-list {
  flex: 0 1 auto;
  overflow: auto;
  max-height: 214px;
  padding: 0 2px 2px 0;
}

.history-panel .panel-head {
  min-height: 30px;
}

.history-panel .mini,
.history-panel .btn.small {
  min-height: 30px;
  height: 30px;
}

.history-panel .btn.small {
  padding: 0 11px;
  font-size: 11.5px;
}

.template-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 6px;
}

.template-toolbar .btn {
  flex: 0 1 auto;
  max-width: 112px;
  min-width: 0;
  min-height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#tplApplyBtn {
  max-width: 126px;
}

.template-new-btn {
  color: #e3b681;
}


.template-new-btn i {
  font-size: 10px;
  margin-right: 2px;
}

.tpl-grid,
.pane.side .tpl-grid {
  gap: 8px;
}

.tpl-card {
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 58px;
  padding: 8px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.018);
}


.tpl-icon {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 12px;
}

.tpl-title {
  font-size: 12.5px;
  line-height: 1.2;
}

.tpl-desc,
.tpl-keywords {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tpl-desc {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.25;
}

.tpl-keywords {
  margin-top: 3px;
  color: var(--fg-subtle);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.25;
}

.tpl-delete {
  align-self: start;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--fg-subtle);
  background: transparent;
  cursor: pointer;
}

.tpl-delete:hover {
  color: var(--accent);
  background: var(--surface-soft);
}

.template-create {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.template-create label {
  display: grid;
  gap: 5px;
  margin: 0;
}

.template-create label span {
  color: var(--fg-subtle);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.template-create input,
.template-create textarea {
  width: 100%;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--fg);
  background: var(--input-bg);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}

.template-create textarea {
  min-height: 48px;
}

.template-create-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 3px 4px;
  border: 0;
  border-radius: 8px;
  color: var(--fg);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.history-item:hover {
  background: var(--surface-soft);
}

.history-thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: var(--fg-subtle);
  background: var(--surface-soft);
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.history-copy strong {
  color: var(--fg);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.history-copy em,
.history-empty {
  color: var(--fg-subtle);
  font-size: 11.5px;
  font-style: normal;
}

.history-copy em {
  line-height: 1.2;
}

.btn {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  background: var(--surface-soft);
  box-shadow: none;
  font-size: 13px;
  font-weight: 780;
  letter-spacing: -0.01em;
}

.btn:hover {
  transform: none;
  border-color: var(--line-strong);
  background: var(--surface-strong);
}

.btn.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}

.btn.xsmall {
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #c8744e, #d38a59);
  box-shadow: 0 10px 26px rgba(211, 138, 89, 0.28);
}


.pane.assets,
.pane.meta {
  min-height: calc(100vh - 126px);
  background: var(--surface);
  border-color: var(--line);
}

.pane.assets {
  gap: 0;
}

.pane-title {
  display: flex;
  align-items: center;
  margin: 0 0 24px;
}

.pane.assets .pane-title {
  margin-bottom: 8px;
}

.pane-title .right-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  width: 100%;
}

#selectBtn {
  color: #e3b681;
  border-color: rgba(211, 138, 89, 0.75);
  background: rgba(211, 138, 89, 0.12);
}


#selCount {
  display: none !important;
}

.switch {
  width: 18px;
  height: 18px;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch .slider {
  inset: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
}

.switch .slider::before {
  display: none;
}

.switch input:checked+.slider {
  border-color: transparent;
  background: var(--brand-strong);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.82);
}

.switch-label {
  margin-left: -8px;
  color: var(--fg);
  font-size: 13px;
  font-weight: 760;
}

.assets-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.assets-summary {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 760;
}

.assets-summary::first-letter {
  color: var(--fg);
}

.view-toggle {
  display: inline-flex;
  gap: 8px;
}

.view-toggle button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg-muted);
  background: var(--surface-soft);
}

.view-toggle button.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #c8744e, #d38a59);
}


.dropzone {
  position: static;
  inset: auto;
  display: none !important;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.grid {
  --asset-thumb-size: clamp(102px, 8vw, 124px);
  --asset-grid-row-gap: 16px;
  --asset-card-extra: 23px;
  --asset-card-height: calc(var(--asset-thumb-size) + var(--asset-card-extra));
  display: grid;
  grid-template-columns: repeat(4, minmax(0, var(--asset-thumb-size)));
  grid-auto-rows: var(--asset-card-height);
  justify-content: space-between;
  gap: var(--asset-grid-row-gap) 12px;
  width: 100%;
  height: auto;
  min-height: 0;
  max-height: clamp(548px, calc(32vw + 140px), 636px);
  padding: 0;
  margin-top: 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-items: start;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: var(--asset-card-height);
  max-height: var(--asset-card-height);
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.card:hover {
  transform: none;
  background: transparent;
}

.card .thumb,
.card img.thumb,
.card.placeholder .thumb {
  width: 100%;
  height: var(--asset-thumb-size);
  aspect-ratio: auto;
  min-height: 0;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}


.card.placeholder .thumb {
  opacity: 0.58;
}

.card.selected,
.card:focus-within {
  border: 0;
  box-shadow: none;
}

.asset-check {
  position: absolute;
  top: 7px;
  left: 7px;
  z-index: 3;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: #15191a;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  font-size: 10px;
}

.card.selected .asset-check {
  color: #15191a;
  border-color: rgba(227, 182, 129, 0.8);
  background: #e3b681;
}


.card .meta {
  position: static;
  inset: auto;
  min-height: 17px;
  margin-top: 6px;
  padding: 0;
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
  background: transparent;
  border: 0;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.card .meta span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  font-weight: 700;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-red {
  background: #ff523d;
}

.status-yellow {
  background: #f2b94c;
}

.status-green {
  background: #30b366;
}

.asset-remove {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--fg-subtle);
  background: transparent;
  cursor: pointer;
}

.asset-remove:hover {
  color: var(--accent);
}

.pane.camera {
  margin-top: 20px;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(211, 138, 89, 0.10), transparent 34%),
    linear-gradient(135deg, rgba(46, 48, 48, 0.66), rgba(21, 25, 26, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 16px 36px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(16px);
  overflow: hidden;
}


.camera-content {
  max-height: none;
  display: block;
  padding: 0;
  overflow: visible;
}

.camera-info-panel {
  display: grid;
  gap: 9px;
}

.camera-info-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--fg-muted);
  font-size: 10.5px;
  font-weight: 840;
  letter-spacing: 0.075em;
  line-height: 1;
  text-transform: uppercase;
}

.camera-heading-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(211, 138, 89, 0.74);
  border-radius: 5px;
  color: #e3b681;
  background: rgba(211, 138, 89, 0.10);
  box-shadow: 0 0 14px rgba(211, 138, 89, 0.18);
}

.camera-info-shell {
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(46, 48, 48, 0.68), rgba(29, 31, 31, 0.54));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
  overflow: hidden;
}


.camera-primary-row,
.camera-secondary-row {
  display: grid;
  min-width: 0;
}

.camera-primary-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 9px 6px;
}

.camera-secondary-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 8px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}


.camera-metric {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 0 6px;
  text-align: center;
}

.camera-metric + .camera-metric {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}


.camera-metric-icon {
  color: #e3b681;
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 0 16px rgba(211, 138, 89, 0.22);
}


.camera-secondary-row .camera-metric-icon {
  font-size: 12px;
}

.camera-metric-label {
  color: var(--fg-subtle);
  font-size: 8.75px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
}

.camera-metric-value {
  max-width: 100%;
  color: var(--fg);
  font-size: 9.75px;
  font-weight: 760;
  line-height: 1.16;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.camera-primary-row .camera-metric-value {
  font-size: 10.5px;
  font-weight: 780;
}

.camera-primary-row .camera-metric:first-child .camera-metric-value {
  font-size: 8.4px;
  line-height: 1.08;
  -webkit-line-clamp: 3;
}

.camera-metric.warn .camera-metric-value {
  color: var(--warn);
}

.camera-info-panel.idle .camera-heading-icon,
.camera-metric.idle .camera-metric-icon {
  color: var(--fg-subtle);
  border-color: rgba(148, 163, 184, 0.30);
  background: rgba(148, 163, 184, 0.055);
  box-shadow: none;
  text-shadow: none;
}

.camera-info-panel.idle .camera-info-heading,
.camera-metric.idle .camera-metric-label,
.camera-metric.idle .camera-metric-value {
  color: var(--fg-subtle);
}

.camera-note {
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: var(--fg-muted);
  background: rgba(255, 207, 102, 0.055);
  font-size: 9.5px;
  line-height: 1.35;
}


.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
}

.toolbar-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  justify-self: start;
  width: min(100%, 420px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: var(--surface-soft);
  overflow: hidden;
}

.toolbar-buttons .btn {
  min-width: 0;
  min-height: 40px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 12px;
}

.toolbar-buttons .btn.primary {
  border-radius: 9px;
  background: linear-gradient(135deg, #c8744e, #d38a59);
}


.generate-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.generate-btn::before {
  content: "";
  position: absolute;
  inset: -40% -28%;
  z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.2) 48%, transparent 64%);
  transform: translateX(-48%);
  animation: generate-sheen 4.8s ease-in-out infinite;
}

.generate-orbit {
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  animation: generate-pulse 2.4s ease-in-out infinite;
}

@keyframes generate-sheen {
  0%,
  62% {
    transform: translateX(-52%);
    opacity: 0;
  }

  72% {
    opacity: 0.7;
  }

  100% {
    transform: translateX(52%);
    opacity: 0;
  }
}

@keyframes generate-pulse {
  0%,
  100% {
    transform: scale(0.78);
    opacity: 0.52;
  }

  45% {
    transform: scale(1);
    opacity: 0.95;
  }
}

@media (prefers-reduced-motion: reduce) {
  .generate-btn::before,
  .generate-orbit {
    animation: none;
  }
}

.toolbar .tokens {
  color: var(--fg-muted);
  font-size: 13px;
  font-weight: 760;
}

.toolbar .tokens strong {
  color: var(--fg);
  font-size: 16px;
}

.platform-section {
  margin: 0;
  padding: 0 0 18px;
  border-top: 0;
  border-bottom: 0;
}

.platform-head {
  margin: 0 0 10px;
}

.csv-template-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.meta-csv-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: -2px 0 0;
}

.csv-template-tab,
.tagchip {
  min-height: 39px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 760;
}

.csv-template-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #c8744e, #d38a59);
  box-shadow: none;
}


.topbar-csv-tabs {
  max-width: min(45vw, 540px);
  margin: 0 4px 0 0;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.topbar-csv-tabs::-webkit-scrollbar {
  display: none;
}

.topbar-csv-tabs .csv-template-tab {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  white-space: nowrap;
}

.meta-csv-tabs .csv-template-tab {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 11px;
  white-space: nowrap;
}

.platform-section label,
.form label {
  display: block;
  margin: 0;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.check-grid label {
  display: inline-flex;
  width: auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.check-grid input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 16px;
  width: 16px;
  min-width: 16px;
  max-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  accent-color: var(--brand-strong);
  background: initial;
  box-shadow: none;
}

.check-grid span {
  color: var(--fg-muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: none;
}

.platform-section input,
.platform-section textarea,
.platform-section select,
.form input,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  background: var(--input-bg);
  box-shadow: none;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.65;
}

.platform-section input {
  min-height: 54px;
  padding: 0 16px;
}

.platform-section select {
  min-height: 54px;
  height: 54px;
  padding: 0 38px 0 16px;
  border-radius: 8px;
  line-height: 1.4;
}

.form input {
  min-height: 48px;
  padding: 0 14px;
  line-height: 1.5;
}

.platform-section textarea {
  min-height: 64px;
  padding: 16px;
  resize: vertical;
}

.form textarea {
  min-height: 58px;
  padding: 12px 14px;
  line-height: 1.5;
  resize: vertical;
}

.platform-section input:focus,
.platform-section textarea:focus,
.platform-section select:focus,
.form input:focus,
.form textarea:focus {
  outline: none;
  border-color: rgba(211, 138, 89, 0.54);
  box-shadow: 0 0 0 4px rgba(211, 138, 89, 0.12);
}


.field-full {
  position: relative;
}

.field-limit {
  display: block;
  margin-top: 4px;
  color: var(--fg-subtle);
  text-align: right;
  font-size: 12px;
  font-weight: 720;
}

.progress {
  margin: 0;
}

.progress:has(#progressText:empty) {
  display: none;
}

.progress .bar {
  display: none;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
}

.progress #progressBar {
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-strong), var(--accent));
}

.progress .info {
  min-height: 16px;
  margin-top: 0;
  color: var(--fg-subtle);
  font-size: 12px;
}

.right-actions .progress {
  flex: 0 0 auto;
  min-width: 96px;
  align-self: center;
}

.right-actions .progress .info {
  min-height: 0;
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.form {
  display: grid;
  gap: 12px;
  max-width: none;
  margin-top: 0;
  margin-bottom: 14px;
  padding-bottom: 0;
  border-bottom: 0;
}

.meta-section-title {
  margin: 0 0 10px;
  color: var(--fg);
  font-size: 14px;
  font-weight: 860;
  letter-spacing: 0.03em;
}

.form .field-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 7px;
}

.form .field-head > span {
  color: #e3b681;
}


.inline-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

#descInput {
  min-height: 84px;
  height: 84px;
  max-height: 84px;
  overflow-y: auto;
}

#keywordsInput.keywords-input {
  min-height: 42px;
  height: 42px;
  max-height: 42px;
  overflow-y: auto;
  resize: none;
}

.ai-hint-field {
  margin-top: 0;
}

#aiHintInput {
  min-height: 48px;
  height: 48px;
  max-height: 84px;
  overflow-y: auto;
}

.badge {
  min-width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--fg-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 780;
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding: 8px;
  min-height: 0;
}

.kw-chips:empty {
  display: none;
}

.tagchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--fg);
  background: var(--surface-soft);
  box-shadow: none;
}

.kw-chips .tagchip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 720;
}

.chip-close {
  width: 16px;
  height: 16px;
  color: var(--fg-muted);
  background: transparent;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  padding: 14px 22px 24px;
  border-top: 1px solid var(--line);
}

.feature-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 16px;
  min-height: 94px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.feature-icon {
  width: 50px;
  height: 50px;
}

.feature-icon.blue {
  color: #7d8cff;
  background: rgba(77, 92, 220, 0.16);
}

.feature-icon.green {
  color: #39d581;
  background: rgba(47, 193, 112, 0.13);
}


.feature-card h3 {
  margin: 0 0 4px;
  color: var(--fg);
  font-size: 15px;
  font-weight: 820;
}

.feature-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.feature-card>.fa-arrow-right {
  color: var(--fg-muted);
}

.footer {
  display: none;
}

@media (min-width: 1500px) {
  .grid {
    --asset-thumb-size: 126px;
    max-height: 644px;
    gap: 16px 14px;
  }
}

@media (max-width: 1280px) {
  .topbar {
    min-height: 78px;
    padding-inline: 18px;
  }

  .model-inline {
    margin-left: 22px;
  }

  .topbar-csv-tabs {
    max-width: min(38vw, 430px);
  }

  .models {
    gap: 12px;
  }

  .chip span {
    padding-inline: 12px;
  }

  .split {
    grid-template-columns: 232px minmax(360px, 1fr) minmax(360px, 1fr);
    padding-inline: 14px;
  }

  .pane.side {
    margin-left: -14px;
  }

  .pane {
    padding: 16px 20px 20px;
  }

  .toolbar-buttons .btn {
    padding-inline: 16px;
  }

}

@media (max-width: 1040px) {
  .topbar {
    position: relative;
    flex-wrap: wrap;
    padding-block: 14px;
  }

  .brand {
    flex-basis: 100%;
  }

  .model-inline {
    margin-left: auto;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .pane.side {
    margin-left: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

  .camera-primary-row,
  .camera-secondary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 16px;
  }

  .camera-primary-row .camera-metric:nth-child(3n+1),
  .camera-secondary-row .camera-metric:nth-child(3n+1) {
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .brand {
    flex-wrap: wrap;
  }

  .model-inline {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }

  .topbar-csv-tabs {
    order: 3;
    width: 100%;
    max-width: 100%;
  }

  .models {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .actions {
    width: 100%;
    justify-content: flex-end;
  }

  .split,
  .feature-strip {
    padding-inline: 10px;
  }

  .pane {
    padding: 18px;
  }

  .pane-title .right-actions,
  .toolbar {
    display: flex;
    flex-wrap: wrap;
  }

  .toolbar-buttons {
    width: 100%;
    overflow-x: auto;
  }

  .grid {
    --asset-thumb-size: clamp(96px, 28vw, 124px);
    --asset-grid-row-gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: var(--asset-grid-row-gap) 10px;
    max-height: min(518px, 72vh);
  }

  .pane.camera {
    padding: 13px 12px 14px;
  }

  .camera-primary-row,
  .camera-secondary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-inline: 8px;
  }

  .camera-primary-row .camera-metric + .camera-metric,
  .camera-secondary-row .camera-metric + .camera-metric {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
  }

  .camera-primary-row .camera-metric:nth-child(2n+1),
  .camera-secondary-row .camera-metric:nth-child(2n+1) {
    border-left: 0;
  }

}
