:root {
  --bg: #f4f6fb;
  --bg-accent: #e8eef8;
  --panel: #ffffff;
  --line: rgba(26, 46, 88, 0.12);
  --line-strong: rgba(26, 46, 88, 0.18);
  --text: #152238;
  --text-muted: #5a6b85;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 48px rgba(15, 23, 42, 0.1);
  --radius-panel: 20px;
  --radius-input: 12px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(37, 99, 235, 0.08), transparent 55%),
    radial-gradient(900px 500px at 88% 0%, rgba(14, 165, 233, 0.06), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 28px;
  padding: clamp(16px, 3vw, 28px);
  max-width: 1440px;
  margin: 0 auto;
}

.controls {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 20px 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 16px;
  height: calc(100vh - 32px);
  overflow: auto;
  box-shadow: var(--shadow-md);
  scrollbar-color: rgba(37, 99, 235, 0.35) transparent;
  scrollbar-width: thin;
}

.controls::-webkit-scrollbar {
  width: 8px;
}

.controls::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.28);
  border-radius: 999px;
}

.controls-header {
  padding-bottom: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.admin-request-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
  margin-bottom: 8px;
}

.admin-request-form h2 {
  margin: 0;
  font-size: 15px;
  color: var(--text);
}

#requestSubmitBtn {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.controls h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

#backToRequestBtn {
  align-self: flex-start;
  margin-bottom: 10px;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

#backToRequestBtn:hover:not(:disabled) {
  background: #f8fafc;
}

.video-frame-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  background: var(--accent-soft);
  border: 1px solid var(--line);
}

.video-frame-hint {
  margin: 0;
  font-size: 0.85rem;
}

.hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 500;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
}

.toggle-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--text);
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-input);
  background: var(--accent-soft);
  border: 1px solid rgba(37, 99, 235, 0.12);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

input,
textarea,
select,
button {
  font: inherit;
}

input[type="text"],
textarea,
select {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  padding: 11px 12px;
  background: #fbfcfe;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input[type="text"]:hover,
textarea:hover,
select:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%235a6b85' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-input);
  cursor: pointer;
  background: #fff;
}

input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  accent-color: var(--accent);
  cursor: pointer;
}

input[type="file"] {
  padding: 10px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent-soft);
  border-color: rgba(37, 99, 235, 0.35);
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.actions.single {
  grid-template-columns: 1fr;
}

button {
  border: none;
  border-radius: var(--radius-input);
  padding: 11px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.post-card,
.post-card * {
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  font-weight: 500;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

#fillPresetBtn {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}

#fillPresetBtn:hover:not(:disabled) {
  background: #f8fafc;
}

#downloadBtn {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

#downloadBtn:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

#downloadUnifiedBtn {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
  width: 100%;
}

#downloadUnifiedBtn:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
}

#applyRubricBtn {
  background: var(--accent-soft);
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.22);
}

#applyRubricBtn:hover:not(:disabled) {
  background: #e0e9ff;
}

#downloadSeriesBtn {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(30, 41, 59, 0.2);
}

#downloadSeriesBtn:hover:not(:disabled) {
  box-shadow: 0 10px 24px rgba(30, 41, 59, 0.28);
}

.preview-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
}

.preview-header strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

#sizeBadge {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.card-wrapper {
  border: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: clamp(16px, 2.5vw, 28px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  box-shadow: var(--shadow-md);
  min-height: 320px;
}

.post-card {
  width: 540px;
  height: 540px;
  border-radius: 0;
  overflow: hidden;
  position: relative;
  background: #0f2a6e;
  box-shadow: var(--shadow-lg);
  color: white;
}

.bg-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
}

.brand {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.content {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.title {
  margin-top: auto;
  max-width: var(--dynamic-title-max-width, 72%);
  line-height: 1;
  text-transform: uppercase;
}

.title-line-1 {
  font-size: var(--dynamic-title-1-size, 58px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.title-line-2 {
  font-size: var(--dynamic-title-2-size, 60px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.subtitle {
  margin-top: 10px;
  font-size: var(--dynamic-subtitle-size, 24px);
  font-weight: 700;
  opacity: 0.95;
  overflow-wrap: anywhere;
}

.chip-btn,
.footer-bar {
  margin-top: 14px;
  align-self: flex-start;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 19px;
}

.footer-bar {
  margin-top: auto;
  width: calc(100% + 52px);
  margin-left: -26px;
  margin-bottom: -26px;
  border-radius: 0;
  text-align: center;
  padding: 14px 20px;
}

.list-block {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  max-width: 80%;
}

.list-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 22px;
  font-weight: 700;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  margin-top: 9px;
  flex: 0 0 auto;
}

.cards-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 12px 10px;
  min-height: 126px;
  color: #152548;
  text-align: center;
}

.mini-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
}

.mini-title {
  font-weight: 900;
  font-size: 21px;
}

.mini-desc {
  font-size: 14px;
  margin-top: 5px;
}

.template-clean .overlay,
.template-specialties .overlay,
.template-steps .overlay {
  background: rgba(255, 255, 255, 0.92);
}

.template-clean .brand,
.template-clean .content,
.template-specialties .brand,
.template-specialties .content,
.template-steps .brand,
.template-steps .content {
  color: #132446;
}

.template-clean .title,
.template-specialties .title,
.template-steps .title {
  margin-top: 50px;
}

.template-steps .list-item {
  font-size: 20px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  flex: 0 0 auto;
}

.template-life .title,
.template-achievement .title {
  margin-top: auto;
  max-width: 82%;
}

.template-achievement .list-block {
  max-width: 100%;
}

.template-photo-gradient .overlay {
  background: rgba(0, 0, 0, 0.08);
}

.template-photo-gradient .content {
  padding: 0;
}

.photo-gradient-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.photo-gradient-content {
  position: absolute;
  inset: 0 auto 0 0;
  width: 68%;
  z-index: 2;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.template-photo-gradient .title {
  margin-top: auto;
  max-width: 92%;
}

.template-photo-gradient .list-block {
  max-width: 100%;
}

.template-insta-unified .overlay {
  background: rgba(0, 0, 0, 0.2);
}

.template-insta-unified .brand {
  display: none;
}

.template-insta-unified .content {
  padding: 0;
}

.insta-unified-top-fade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.26) 0%, rgba(0, 0, 0, 0.08) 28%, rgba(0, 0, 0, 0) 100%);
}

.insta-unified-bottom-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.insta-unified-noise {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.3) 0.8px, transparent 0.8px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
}

.insta-unified-video-gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5, 10, 20, 0.58) 0%, rgba(5, 10, 20, 0.2) 28%, rgba(5, 10, 20, 0.06) 52%),
    linear-gradient(0deg, rgba(5, 10, 20, 0.74) 0%, rgba(5, 10, 20, 0.28) 34%, rgba(5, 10, 20, 0) 66%);
}

.insta-unified-brand-chip {
  position: absolute;
  left: 22px;
  top: 22px;
  z-index: 3;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff;
  background: rgba(14, 23, 42, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(5px);
}

.insta-unified-trend-chip {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 3;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1d2433;
  background: linear-gradient(135deg, #ffd777 0%, #fff4d2 100%);
}

.insta-unified-trend-chip.trend-default {
  background: linear-gradient(135deg, #ffd777 0%, #fff4d2 100%);
}

.insta-unified-trend-chip.trend-news {
  background: linear-gradient(135deg, #95b8ff 0%, #dbe8ff 100%);
}

.insta-unified-trend-chip.trend-event {
  background: linear-gradient(135deg, #90e4d4 0%, #ddfff7 100%);
}

.insta-unified-trend-chip.trend-admission {
  background: linear-gradient(135deg, #ffd19f 0%, #fff0de 100%);
}

.insta-unified-logo {
  position: absolute;
  left: 22px;
  top: 22px;
  z-index: 3;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  padding: 6px;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}

.insta-unified-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
}

.insta-unified-logo-fallback {
  display: none;
  width: 100%;
  height: 100%;
  place-items: center;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.6px;
  color: #19324a;
  background: #ffffff;
}

.insta-unified-content {
  position: absolute;
  left: 20px;
  right: 20px;
  width: auto;
  bottom: 20px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 14px 16px 16px;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(20, 31, 52, 0.56) 6%, rgba(20, 31, 52, 0.34) 92%);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.34);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.insta-unified-content.long-copy {
  width: auto;
}

.unified-news .insta-unified-content {
  background: linear-gradient(140deg, rgba(24, 43, 80, 0.54) 6%, rgba(24, 43, 80, 0.32) 92%);
}

.unified-event .insta-unified-content {
  background: linear-gradient(140deg, rgba(20, 67, 70, 0.54) 6%, rgba(20, 67, 70, 0.32) 92%);
}

.unified-admission .insta-unified-content {
  background: linear-gradient(140deg, rgba(45, 52, 90, 0.54) 6%, rgba(45, 52, 90, 0.34) 92%);
}

.insta-unified-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.insta-unified-meta {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.92;
}

.insta-unified-date {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
}

.insta-unified-cta {
  display: inline-flex;
  align-self: flex-start;
  margin-top: 2px;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  color: #1a2435;
  background: linear-gradient(135deg, #ffe297 0%, #ffd36e 100%);
  text-transform: uppercase;
  letter-spacing: 0.35px;
}

.template-insta-unified .title {
  margin: 0;
  max-width: var(--dynamic-title-max-width, 100%);
  line-height: 1.02;
  text-transform: none;
}

.template-insta-unified .unified-title-line {
  font-size: var(--dynamic-title-1-size, 50px);
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.5);
  line-height: 1.1;
  letter-spacing: 0.2px;
  overflow-wrap: anywhere;
}

.insta-unified-mark {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 3;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  opacity: 1;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.34);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Обложка под видео: тот же стиль, что у #kvki, в правом верхнем углу */
.insta-unified-video-badge {
  position: absolute;
  right: 22px;
  top: 22px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.34);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.template-insta-unified.cover-from-video .insta-unified-content {
  bottom: 198px;
  background: linear-gradient(145deg, rgba(8, 14, 28, 0.84) 4%, rgba(8, 14, 28, 0.62) 88%);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

.template-insta-unified.cover-from-video .insta-unified-logo {
  top: 156px;
}

.template-insta-unified.cover-from-video .insta-unified-video-badge {
  top: 156px;
}

.template-insta-unified.cover-from-video .unified-title-line {
  font-weight: 600;
  font-size: clamp(18px, 2.05vw, 26px);
  line-height: 1.08;
  letter-spacing: 0.1px;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.82);
}

.template-insta-unified.cover-from-video .insta-unified-mark {
  bottom: 186px;
}

.insta-unified-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 1;
  padding-left: 2px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a2435;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.template-practice-day .brand {
  top: 26px;
  left: 26px;
  font-size: 20px;
}

.template-practice-day .overlay {
  background: rgba(0, 0, 0, 0.06);
}

.practice-left-panel {
  position: absolute;
  inset: 0 auto 0 0;
  width: 66%;
  z-index: 2;
}

.practice-content {
  position: absolute;
  z-index: 3;
  top: 130px;
  left: 34px;
  max-width: 58%;
}

.practice-title {
  margin: 0;
  max-width: 100%;
}

.template-practice-day .title-line-1 {
  font-size: var(--dynamic-title-1-size, 56px);
}

.template-practice-day .title-line-2 {
  font-size: var(--dynamic-title-2-size, 58px);
}

.template-user-topic .content {
  padding: 0;
}

.user-topic-content {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  z-index: 3;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(12, 20, 34, 0.72) 0%, rgba(12, 20, 34, 0.52) 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
}

.template-user-topic .title {
  margin: 0;
  max-width: 100%;
  text-transform: none;
}

.template-user-topic .title-line-1 {
  font-size: clamp(28px, 3.4vw, 52px);
  line-height: 1.1;
  font-weight: 700;
  color: #ffffff;
}

.user-topic-description {
  margin: 0;
  font-size: clamp(14px, 1.5vw, 24px);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.95);
  white-space: pre-wrap;
}

.practice-line {
  width: 74px;
  height: 6px;
  border-radius: 99px;
  margin: 18px 0 20px;
}

.practice-subtitle {
  margin: 0;
  font-size: var(--dynamic-subtitle-size, 24px);
  line-height: 1.12;
  font-weight: 700;
}

.practice-dots {
  position: absolute;
  right: 20px;
  top: 26px;
  z-index: 3;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 8px;
  font-size: 13px;
}

.practice-corner {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 136px solid transparent;
  border-bottom: 80px solid #ffd029;
}

@media (max-width: 1140px) {
  .app {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 16px;
  }

  .controls {
    position: static;
    height: auto;
    max-height: none;
  }

  .card-wrapper {
    min-height: 280px;
  }
}

/* User page UX redesign */
.user-form-page {
  min-height: 100vh;
}

.user-layout {
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 36px);
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(320px, 620px);
  gap: clamp(20px, 3vw, 36px);
  align-items: start;
  width: 100%;
}

.user-hero {
  padding: clamp(6px, 1.8vw, 14px);
}

.user-hero-kicker {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2f6df5;
}

.user-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: #101e34;
}

.user-hero-text {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(1rem, 1.7vw, 1.15rem);
  line-height: 1.55;
  color: #495d79;
}

.user-form-shell {
  width: 100%;
}

.user-form-page .admin-request-form {
  gap: 14px;
  padding: clamp(18px, 2.5vw, 28px);
  border: 1px solid #d8e2f2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(20, 41, 78, 0.1);
}

.user-form-page .admin-request-form h2 {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  letter-spacing: -0.01em;
  color: #10213a;
}

.user-form-page label {
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #3f5370;
}

.user-form-page .label-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-form-page .required-mark {
  color: #dc2626;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.user-form-page input[type="text"],
.user-form-page textarea,
.user-form-page input[type="file"] {
  min-height: 52px;
  font-size: 1rem;
}

.user-form-page input[type="text"],
.user-form-page textarea {
  border-radius: 14px;
  padding: 14px 15px;
  border: 1px solid #cfd9ea;
  background: #fbfdff;
}

.user-form-page input:required:invalid,
.user-form-page textarea:required:invalid {
  border-color: #ef4444;
  background: #fff5f5;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.user-form-page input:required:valid,
.user-form-page textarea:required:valid {
  border-color: #86d5a6;
  background: #f4fff8;
}

.user-form-page input:required:focus:invalid,
.user-form-page textarea:required:focus:invalid {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16);
}

.user-form-page textarea {
  min-height: 150px;
}

.user-form-page input[type="file"] {
  padding: 10px 0;
}

.user-form-page #requestSubmitBtn {
  min-height: 56px;
  margin-top: 4px;
  border-radius: 14px;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.3);
}

.user-form-page #requestStatus {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #f6f8fc;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

.user-form-page #requestStatus.status-info {
  color: #28446f;
  border-color: #d3deef;
  background: #f4f8ff;
}

.user-form-page #requestStatus.status-success {
  color: #0f5132;
  border-color: #bde7cf;
  background: #e9f9f0;
}

.user-form-page #requestStatus.status-success::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.user-form-page #requestStatus.status-error {
  color: #7a1b1b;
  border-color: #f0c9c9;
  background: #fff1f1;
}

.user-form-page #requestStatus.status-error::before {
  content: "!";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.request-progress {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d4e0f6;
  background: #f3f7ff;
}

.request-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  color: #3f5370;
}

.request-progress-top strong {
  color: #1c4cc0;
}

.request-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dfe8f8;
  overflow: hidden;
}

.request-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #3b82f6 100%);
  transition: width 0.15s ease;
}

.request-preview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d8e2f2;
  background: #f8fbff;
}

.request-preview-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3f5370;
}

.request-preview img,
.request-preview video {
  width: 100%;
  max-height: 280px;
  border-radius: 10px;
  border: 1px solid #d9e3f0;
  background: #fff;
  object-fit: contain;
}

.success-modal {
  z-index: 1200;
  padding: 18px;
  border: none;
  background: transparent;
  max-width: none;
  max-height: none;
}

.success-modal::backdrop {
  background: rgba(12, 22, 40, 0.54);
  backdrop-filter: blur(2px);
}

.success-modal-dialog {
  position: relative;
  width: min(620px, calc(100vw - 28px));
  border-radius: 20px;
  padding: clamp(22px, 3.5vw, 34px);
  background: #ffffff;
  border: 1px solid #d8e2f2;
  box-shadow: 0 28px 60px rgba(12, 26, 52, 0.28);
  text-align: center;
  pointer-events: auto;
}

.success-modal-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
}

.success-modal-dialog h2 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.15;
  color: #11233c;
}

.success-modal-dialog p {
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  line-height: 1.5;
  color: #3e5371;
}

#successModalCloseBtn {
  margin-top: 18px;
  min-width: 180px;
  min-height: 50px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 920px) {
  .user-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: clamp(16px, 4.5vw, 24px);
  }

  .user-hero {
    padding: 0;
  }

  .user-hero-text {
    max-width: 100%;
  }

  .user-form-page .admin-request-form {
    padding: clamp(16px, 3.8vw, 24px);
  }
}

@media (max-width: 640px) {
  .user-form-page {
    background:
      linear-gradient(180deg, #eef4ff 0%, #f7faff 32%, #f3f7ff 100%);
  }

  .user-layout {
    padding: 0 0 16px;
    gap: 10px;
  }

  .user-hero {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 12px;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(176, 194, 221, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .user-hero-kicker {
    margin-bottom: 4px;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
  }

  .user-hero h1 {
    font-size: clamp(1.18rem, 5.8vw, 1.45rem);
    line-height: 1.2;
    margin: 0;
  }

  .user-hero-text {
    margin-top: 6px;
    max-width: 100%;
    font-size: 0.86rem;
    line-height: 1.4;
    color: #5a6b86;
  }

  .user-form-page .admin-request-form {
    gap: 11px;
    margin: 0 10px;
    padding: 14px 12px;
    border-radius: 18px;
    border: 1px solid #d9e3f3;
    box-shadow: 0 10px 28px rgba(27, 52, 96, 0.12);
  }

  .user-form-page .admin-request-form h2 {
    font-size: 1.05rem;
    margin-bottom: 2px;
  }

  .user-form-page input[type="text"],
  .user-form-page textarea {
    min-height: 46px;
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 0.96rem;
  }

  .user-form-page textarea {
    min-height: 114px;
  }

  .user-form-page input[type="file"] {
    min-height: auto;
    padding: 0;
    font-size: 0.9rem;
  }

  .user-form-page input[type="file"]::file-selector-button {
    width: 100%;
    margin-right: 0;
    margin-bottom: 7px;
    min-height: 42px;
    border-radius: 11px;
  }

  .request-preview,
  .request-progress {
    padding: 9px;
    border-radius: 11px;
  }

  .user-form-page #requestStatus {
    min-height: 0;
    align-items: flex-start;
    padding: 9px 10px;
    font-size: 0.85rem;
    border-radius: 10px;
  }

  .user-form-page #requestSubmitBtn {
    min-height: 52px;
    border-radius: 13px;
    font-size: 0.98rem;
    position: sticky;
    bottom: 10px;
    z-index: 9;
  }

  .success-modal {
    padding: 10px;
  }

  .success-modal-dialog {
    width: min(620px, calc(100vw - 12px));
    border-radius: 14px;
    padding: 18px 14px;
  }

  #successModalCloseBtn {
    min-width: 100%;
  }
}

@media (max-width: 420px) {
  .user-layout {
    gap: 8px;
  }

  .user-hero-kicker {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }

  .user-hero h1 {
    font-size: clamp(1.08rem, 6.5vw, 1.24rem);
    line-height: 1.24;
  }

  .user-hero-text {
    margin-top: 4px;
    font-size: 0.8rem;
  }

  .user-form-page .admin-request-form {
    margin: 0 8px;
    padding: 12px 10px;
    border-radius: 14px;
  }

  .user-form-page label {
    font-size: 0.82rem;
    gap: 6px;
  }

  .user-form-page input[type="text"],
  .user-form-page textarea {
    min-height: 44px;
    font-size: 0.92rem;
    padding: 10px 11px;
  }

  .user-form-page textarea {
    min-height: 98px;
  }

  .user-form-page input[type="file"]::file-selector-button {
    min-height: 40px;
    font-size: 0.82rem;
  }

  .user-form-page #requestSubmitBtn {
    min-height: 50px;
    font-size: 0.93rem;
    bottom: 8px;
  }

  .user-form-page #requestStatus {
    font-size: 0.8rem;
  }

  .success-modal-dialog {
    width: calc(100vw - 10px);
    border-radius: 12px;
    padding: 16px 12px;
  }
}
