:root {
  --navy: #08194d;
  --blue: #1023ad;
  --gold: #ffb31a;
  --sky: #3cb3f4;
  --ink: #101828;
  --muted: #667085;
  --line: #dce3f0;
  --surface: #f4f6fb;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--surface); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.simple-page { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 10%, rgba(255,179,26,.17), transparent 27rem), var(--surface); }
.simple-header { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px max(20px, calc((100% - 960px) / 2)); border-bottom: 5px solid var(--gold); background: var(--navy); }
.simple-header img { width: 195px; height: auto; }
.simple-header > span { padding: 8px 13px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #dce5ff; font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }

.chooser { width: min(760px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 48px; text-align: center; }
.mini-label { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: 11px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.chooser h1, .simple-editor h1 { margin: 7px 0; font-size: clamp(30px, 6vw, 44px); line-height: 1.06; letter-spacing: -.04em; }
.chooser > p { margin: 0; color: var(--muted); font-size: 15px; }
.simple-frame-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 26px; }
.simple-frame-grid > button { position: relative; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 10px 10px 15px; border: 3px solid transparent; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 9px 28px rgba(8,25,77,.08); cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.simple-frame-grid > button:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(8,25,77,.12); }
.simple-frame-grid > button:focus-visible { outline: 4px solid rgba(60,179,244,.45); outline-offset: 2px; }
.simple-frame-grid > button.selected { border-color: var(--gold); box-shadow: 0 14px 36px rgba(255,179,26,.28); }
.simple-frame-preview { position: relative; display: block; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 13px; background: #c8eaff; }
.simple-frame-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.simple-frame-preview img:first-child { width: 90%; height: auto; inset: auto -1% 0 auto; object-fit: contain; }
.simple-frame-grid strong { font-size: 15px; }
.selected-badge { position: absolute; top: 18px; right: 18px; display: flex; align-items: center; gap: 4px; padding: 6px 9px; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: 10px; font-weight: 900; }

.simple-upload-panel { margin: 22px auto 0; padding: 22px; border: 2px solid rgba(255,179,26,.55); border-radius: 18px; background: linear-gradient(180deg, #fffdf5, white); box-shadow: 0 9px 28px rgba(255,179,26,.14); }
.simple-upload-panel h2 { margin: 0 0 14px; font-size: 19px; }
.simple-upload-actions { display: flex; justify-content: center; gap: 10px; }
.simple-upload-actions label { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 19px; border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 900; }
.gallery-button { color: var(--navy); background: var(--gold); }
.camera-button { border: 1px solid var(--blue); color: var(--blue); background: white; }
.simple-upload-panel > p, .simple-controls > p { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 13px 0 0; color: #7b879e; font-size: 11px; }
.simple-status { min-height: 19px; margin: 12px 0 0 !important; color: var(--blue) !important; font-size: 12px !important; font-weight: 800; }

.simple-editor { width: min(900px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 48px; }
.editor-title-row { position: relative; min-height: 64px; display: flex; align-items: center; justify-content: center; margin-bottom: 17px; text-align: center; }
.editor-title-row > button { position: absolute; left: 0; display: flex; align-items: center; gap: 6px; padding: 9px 11px; border: 0; border-radius: 10px; color: var(--blue); background: #e6ebfa; cursor: pointer; font-size: 12px; font-weight: 850; }
.editor-title-row h1 { font-size: clamp(27px, 5vw, 38px); }
.editor-title-row p { margin: 0; color: var(--muted); font-size: 13px; }
.simple-editor-card { display: grid; grid-template-columns: minmax(0, 1fr) 290px; overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: 0 18px 52px rgba(8,25,77,.1); }
.simple-preview-column { padding: 18px; background: #e9eef8; }
.simple-format-tabs { width: max-content; display: flex; gap: 5px; margin: 0 auto 13px; padding: 4px; border-radius: 10px; background: #d9e1f0; }
.simple-format-tabs button { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border: 0; border-radius: 7px; color: #69778f; background: transparent; cursor: pointer; font-size: 12px; font-weight: 850; }
.simple-format-tabs button.active { color: var(--blue); background: white; box-shadow: 0 3px 8px rgba(8,25,77,.1); }
.simple-canvas { display: grid; place-items: center; overflow: hidden; margin: auto; border-radius: 15px; background: white; box-shadow: 0 10px 30px rgba(8,25,77,.14); }
.simple-canvas.square { width: min(100%, 520px); aspect-ratio: 1; }
.simple-canvas.story { width: min(100%, 280px); aspect-ratio: 9 / 16; }
.simple-canvas canvas { width: 100%; height: 100%; display: block; object-fit: contain; touch-action: none; cursor: grab; }
.simple-canvas canvas:active { cursor: grabbing; }
.simple-canvas canvas:focus-visible { outline: 4px solid rgba(60,179,244,.55); outline-offset: -4px; }
.simple-controls { display: flex; flex-direction: column; gap: 10px; padding: 22px; border-left: 1px solid var(--line); }
.simple-zoom { display: block; margin-bottom: 4px; }
.simple-zoom > span { display: flex; justify-content: space-between; color: #344054; font-size: 13px; font-weight: 850; }
.simple-zoom output { color: var(--blue); }
.simple-zoom input { width: 100%; margin-top: 10px; accent-color: var(--blue); }
.recenter, .change-photo { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; color: #344054; background: white; cursor: pointer; font-size: 12px; font-weight: 850; }
.simple-downloads { display: grid; gap: 8px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.simple-downloads button { min-height: 47px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 11px; cursor: pointer; font-size: 13px; font-weight: 900; }
.simple-downloads button:first-child { color: var(--navy); background: var(--gold); }
.simple-downloads button:last-child { color: white; background: var(--blue); }
.simple-footer { margin-top: auto; padding: 18px; border-top: 4px solid var(--gold); color: #9da8c2; background: var(--navy); text-align: center; font-size: 10px; }
.simple-footer span, .simple-footer a { margin: 0 8px; }
.simple-footer a { color: #c8d3ee; text-decoration: none; }
.simple-footer a:hover { color: var(--gold); }

.admin-page, .admin-gate { min-height: 100vh; background: #f3f6fc; }
.admin-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px max(20px, calc((100% - 980px) / 2)); border-bottom: 5px solid var(--gold); background: var(--navy); }
.admin-header img { width: 190px; height: auto; }
.admin-header > div { display: flex; align-items: center; gap: 14px; color: #bec9e4; font-size: 11px; }
.admin-header form { margin: 0; }
.admin-header button { border: 0; color: white; background: transparent; cursor: pointer; font-weight: 850; }
.admin-content { width: min(800px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 60px; }
.admin-title > span { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.admin-title h1 { margin: 10px 0 6px; font-size: clamp(30px, 5vw, 43px); line-height: 1.05; letter-spacing: -.04em; }
.admin-title p { margin: 0; color: var(--muted); }
.frame-form { margin-top: 25px; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: 0 12px 34px rgba(8,25,77,.08); }
.frame-form > label { display: grid; gap: 7px; color: #344054; font-size: 12px; font-weight: 850; }
.frame-form > label input { min-height: 45px; padding: 0 13px; border: 1px solid #cfd8e8; border-radius: 10px; outline: none; }
.frame-form > label input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(16,35,173,.1); }
.frame-files { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.frame-files > label { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 18px; border: 1.5px dashed #b8c6e0; border-radius: 14px; color: #56637a; background: #f7f9fd; text-align: center; }
.frame-files strong { color: var(--ink); font-size: 13px; }
.frame-files span:not(.upload-shape) { font-size: 10px; }
.frame-files input { width: 100%; margin-top: 5px; color: #667085; font-size: 10px; }
.upload-shape { display: block; border: 3px solid var(--blue); border-radius: 6px; background: rgba(255,179,26,.23); }
.square-shape { width: 35px; height: 35px; }
.story-shape { width: 24px; height: 41px; }
.frame-form > button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; border: 0; border-radius: 11px; color: var(--navy); background: var(--gold); cursor: pointer; font-weight: 900; }
.frame-form > button:disabled { opacity: .6; cursor: wait; }
.admin-message { min-height: 20px; margin: 12px 0; color: var(--blue); text-align: center; font-size: 12px; font-weight: 850; }
.managed-list-heading { display: flex; align-items: center; gap: 9px; margin-top: 28px; }
.managed-list-heading h2 { margin: 0; font-size: 20px; }
.managed-list-heading span { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; color: var(--navy); background: var(--gold); font-size: 11px; font-weight: 900; }
.managed-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 13px; }
.managed-list article { padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: white; box-shadow: 0 7px 22px rgba(8,25,77,.06); }
.managed-previews { height: 145px; display: flex; align-items: flex-end; justify-content: center; gap: 10px; overflow: hidden; border-radius: 10px; background: linear-gradient(145deg, #ccecff, #fff1bc); }
.managed-previews img { width: 122px; aspect-ratio: 1; object-fit: contain; }
.managed-previews img.story { width: 70px; aspect-ratio: 9 / 16; }
.managed-list article > strong { display: block; margin: 10px 0 7px; font-size: 13px; }
.managed-list article > button { padding: 7px 9px; border: 0; border-radius: 8px; color: #b42318; background: #feeceb; cursor: pointer; font-size: 11px; font-weight: 850; }
.admin-empty { grid-column: 1 / -1; min-height: 110px; display: flex; align-items: center; justify-content: center; border: 1px dashed #c7d1e2; border-radius: 14px; color: #7b879c; background: white; text-align: center; font-size: 12px; }

.admin-gate { position: relative; display: grid; place-items: center; padding: 90px 30px 30px; background: var(--navy); }
.admin-gate > img { position: absolute; top: 24px; left: 50%; width: 190px; height: auto; transform: translateX(-50%); }
.admin-gate > form { width: min(420px, 100%); padding: 32px; border-top: 5px solid var(--gold); border-radius: 18px; background: white; text-align: center; }
.gate-lock { font-size: 28px; }
.admin-gate h1 { margin: 12px 0 8px; font-size: 28px; }
.admin-gate p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.admin-gate .login-error { padding: 9px; border-radius: 8px; color: #b42318; background: #feeceb; font-size: 12px; }
.admin-gate label { display: grid; gap: 7px; text-align: left; color: #344054; font-size: 12px; font-weight: 850; }
.admin-gate input[type="password"] { min-height: 45px; padding: 0 12px; border: 1px solid #cfd8e8; border-radius: 10px; }
.admin-gate button { width: 100%; min-height: 46px; margin-top: 14px; border: 0; border-radius: 10px; color: var(--navy); background: var(--gold); cursor: pointer; font-weight: 900; }
.admin-gate a { display: inline-block; margin-top: 16px; color: var(--blue); font-size: 12px; font-weight: 800; text-decoration: none; }

@media (max-width: 700px) {
  .simple-frame-grid { gap: 10px; }
  .simple-frame-grid > button { padding: 7px 7px 12px; border-radius: 16px; }
  .simple-frame-grid strong { font-size: 12px; }
  .selected-badge { top: 12px; right: 12px; padding: 5px 7px; }
  .simple-editor-card { grid-template-columns: 1fr; }
  .simple-controls { border-top: 1px solid var(--line); border-left: 0; }
  .editor-title-row { justify-content: flex-end; text-align: right; }
  .editor-title-row > button { left: 0; }
  .admin-header > div > span { display: none; }
  .frame-files, .managed-list { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .simple-header { min-height: 66px; }
  .simple-header img { width: 165px; }
  .simple-header > span { display: none; }
  .chooser { padding-top: 25px; }
  .simple-frame-grid { margin-top: 20px; }
  .simple-upload-panel { padding: 18px 13px; }
  .simple-upload-actions { flex-direction: column; }
  .simple-upload-actions label { width: 100%; }
  .simple-editor { padding-top: 18px; }
  .editor-title-row > button { position: static; align-self: flex-start; }
  .editor-title-row { gap: 10px; justify-content: space-between; }
  .editor-title-row h1 { font-size: 24px; }
  .editor-title-row p { max-width: 180px; }
  .simple-preview-column { padding: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
