:root {
  --bg: #f5f7fb;
  --panel: rgba(255,255,255,.88);
  --line: #dfe6f1;
  --text: #111827;
  --muted: #657083;
  --blue: #3563ff;
  --blue2: #e8edff;
  --dark: #0f172a;
  --danger: #ef4444;
  --shadow: 0 18px 50px rgba(15, 23, 42, .12);
  --radius: 18px;
  font-family: Pretendard, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  background:
    radial-gradient(circle at top left, rgba(53,99,255,.15), transparent 30%),
    radial-gradient(circle at bottom right, rgba(14,165,233,.14), transparent 32%),
    var(--bg);
  color: var(--text);
}
button, input, textarea, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
  border-radius: 12px;
  min-height: 36px;
  padding: 0 12px;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border .12s ease, box-shadow .12s ease;
  font-weight: 700;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
button:active { transform: translateY(0); }
button.primary { background: var(--blue); border-color: var(--blue); color: white; }
button.dark { background: var(--dark); border-color: var(--dark); color: white; }
button.ghost { background: rgba(255,255,255,.6); }
button.danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
button.full { width: 100%; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  color: var(--text);
}
input[type=color] { padding: 3px; height: 42px; }
input[type=range] { padding: 0; }
textarea { min-height: 110px; resize: vertical; line-height: 1.45; }
label { display: block; margin: 13px 0 7px; font-size: 12px; font-weight: 900; color: #334155; letter-spacing: -.01em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.hidden { display: none !important; }
.app { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(223,230,241,.7);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(18px);
  z-index: 5;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #0f172a, #3563ff);
  color: #fff; font-weight: 900; letter-spacing: -.08em;
  box-shadow: 0 12px 24px rgba(53,99,255,.25);
}
.brand strong { display: block; font-size: 16px; letter-spacing: -.04em; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(380px, 1fr) 310px; gap: 14px; padding: 14px; }
.panel {
  background: var(--panel);
  border: 1px solid rgba(223,230,241,.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.small-tabs { grid-template-columns: repeat(3, 1fr); }
.tab { min-height: 34px; padding: 0 8px; font-size: 12px; border-radius: 11px; background: transparent; border-color: transparent; color: var(--muted); }
.tab.active { background: var(--blue2); border-color: #cdd8ff; color: #1e40af; }

.tab.ai-tab-new {
  position: relative;
  color: #1d4ed8;
  background: linear-gradient(135deg, rgba(219,234,254,.95), rgba(238,242,255,.95));
  border-color: rgba(53,99,255,.34);
  box-shadow: 0 0 0 0 rgba(53,99,255,.28);
  animation: aiTabGlow 1.7s ease-in-out infinite;
}
.tab.ai-tab-new::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 14px;
  border: 1px solid rgba(53,99,255,.22);
  pointer-events: none;
  animation: aiTabPulse 1.7s ease-in-out infinite;
}
.new-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 16px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  vertical-align: 1px;
}
.tab:not(.ai-tab-new) .new-pill { display: none; }
@keyframes aiTabGlow {
  0%,100% { box-shadow: 0 0 0 0 rgba(53,99,255,.18); transform: translateY(0); }
  50% { box-shadow: 0 10px 24px rgba(53,99,255,.18); transform: translateY(-1px); }
}
@keyframes aiTabPulse {
  0%,100% { opacity: .3; transform: scale(.98); }
  50% { opacity: 1; transform: scale(1.04); }
}
.tab-content { display: none; min-height: 0; overflow-y: auto; padding: 14px; }
.tab-content.active { display: block; }
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.template-card {
  min-height: 110px;
  padding: 10px;
  border-radius: 15px;
  border: 1px solid var(--line);
  background: white;
  overflow: hidden;
  position: relative;
  text-align: left;
}
.template-card b { display: block; font-size: 13px; letter-spacing: -.04em; }
.template-card span { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.template-card::after {
  content:""; position:absolute; right:-20px; bottom:-24px; width:70px; height:70px; border-radius:22px;
  background: linear-gradient(135deg, rgba(53,99,255,.18), rgba(14,165,233,.16)); transform: rotate(12deg);
}
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tool-grid button { justify-content: center; min-height: 42px; font-size: 13px; }
.mini-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.color-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.color-row input:nth-child(1):last-child { grid-column: 1 / -1; }
.upload-tile {
  display: grid; place-items: center;
  min-height: 80px;
  margin-top: 12px;
  border: 1.5px dashed #b8c4d8;
  border-radius: 16px;
  background: rgba(248,250,252,.8);
  cursor: pointer;
  color: var(--muted);
}
.upload-tile input { display: none; }
.assets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.asset { aspect-ratio: 1; object-fit: cover; border-radius: 13px; border: 1px solid var(--line); cursor: pointer; background: white; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  width: 40px; height: 32px; border-radius: 11px; border: 1px solid var(--line); background: white; cursor: pointer;
  position: relative; overflow: hidden;
}
.chip[data-pattern=dots] { background-image: radial-gradient(#94a3b8 1.2px, transparent 1.2px); background-size: 10px 10px; }
.chip[data-pattern=grid] { background-image: linear-gradient(#e2e8f0 1px, transparent 1px), linear-gradient(90deg, #e2e8f0 1px, transparent 1px); background-size: 12px 12px; }
.chip[data-pattern=diagonal] { background-image: repeating-linear-gradient(45deg, #e2e8f0 0 2px, transparent 2px 11px); }
.chip[data-pattern=waves] { background-image: radial-gradient(circle at 50% 0, transparent 20%, #e2e8f0 21%, transparent 22%); background-size: 18px 18px; }
.theme-list { display: grid; gap: 8px; }
.theme {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: white; cursor: pointer;
}
.theme b { font-size: 12px; }
.theme .swatches { display: flex; gap: 4px; }
.theme i { width: 18px; height: 18px; border-radius: 7px; display: block; border: 1px solid rgba(0,0,0,.08); }
.smart-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.center-stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.stage-toolbar {
  min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px; background: rgba(255,255,255,.75); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(15,23,42,.06);
}
.toolbar-group { display: flex; align-items: center; gap: 6px; }
.toolbar-group span { font-size: 12px; font-weight: 900; color: var(--muted); min-width: 44px; text-align: center; }
.canvas-wrap {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  overflow: auto;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(223,230,241,.75);
  background:
    linear-gradient(45deg, rgba(148,163,184,.12) 25%, transparent 25%, transparent 75%, rgba(148,163,184,.12) 75%),
    linear-gradient(45deg, rgba(148,163,184,.12) 25%, transparent 25%, transparent 75%, rgba(148,163,184,.12) 75%);
  background-color: rgba(255,255,255,.5);
  background-size: 28px 28px;
  background-position: 0 0, 14px 14px;
}
canvas#stage {
  max-width: none;
  background: white;
  border-radius: 4px;
  box-shadow: 0 28px 70px rgba(15,23,42,.18);
  touch-action: none;
}
.thumb-strip {
  min-height: 112px;
  display: flex; gap: 10px; overflow-x: auto; padding: 9px;
  background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: var(--radius);
}
.thumb {
  width: 82px; height: 92px; flex: 0 0 auto;
  border: 2px solid transparent; border-radius: 14px; background: white; padding: 5px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.thumb.active { border-color: var(--blue); background: var(--blue2); }
.thumb canvas { width: 68px; height: 68px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); }
.thumb span { font-size: 11px; font-weight: 900; color: var(--muted); }
.empty { color: var(--muted); display: grid; place-items: center; min-height: 180px; border: 1px dashed var(--line); border-radius: 15px; background: rgba(248,250,252,.6); }
.inspector { padding-bottom: 20px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 label { margin: 8px 0 0; font-size: 11px; }
.grid2 input, .grid2 select { margin-top: 6px; }
.layer-list { display: grid; gap: 8px; }
.layer {
  display: grid; grid-template-columns: 28px 1fr auto auto; gap: 6px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 13px; background: white; cursor: pointer;
}
.layer.active { outline: 2px solid rgba(53,99,255,.3); background: var(--blue2); }
.layer .type { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #f1f5f9; }
.layer b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer button { min-height: 28px; padding: 0 7px; font-size: 11px; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 12px);
  background: #0f172a; color: white; padding: 12px 16px; border-radius: 999px;
  box-shadow: 0 18px 50px rgba(15,23,42,.25);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 20; font-weight: 800; font-size: 13px;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 270px minmax(340px,1fr); }
  .right-panel { position: fixed; right: 14px; top: 78px; bottom: 14px; width: 310px; z-index: 6; transform: translateX(calc(100% + 20px)); transition: transform .2s ease; }
  .right-panel.open { transform: translateX(0); }
}
@media (max-width: 760px) {
  html, body { overflow: auto; height: auto; }
  .app { min-height: 100vh; height: auto; }
  .topbar { position: sticky; top: 0; }
  .workspace { display: flex; flex-direction: column; padding: 10px; }
  .panel { max-height: none; }
  .center-stage { min-height: 65vh; }
  .stage-toolbar { overflow-x: auto; justify-content: flex-start; }
  .left-panel { order: 2; }
  .right-panel { position: static; transform: none; width: auto; order: 3; }
  .top-actions button { padding: 0 9px; }
  .brand strong { font-size: 14px; }
}

/* account / sharing / export additions */
a.brand { color: inherit; text-decoration: none; }
.status-icon { display:inline-flex; width:18px; height:18px; margin-top:4px; border-radius:999px; align-items:center; justify-content:center; }
.status-icon::before { content:""; width:10px; height:10px; border-radius:999px; background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.12); }
.status-icon.dirty::before { background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.14); }
.status-icon.syncing::before { width:14px; height:14px; border:2px solid #dbeafe; border-top-color:#3563ff; background:transparent; animation:spin .8s linear infinite; box-shadow:none; }
@keyframes spin { to { transform:rotate(360deg); } }
button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.icon-only { width:38px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.icon-label { display:inline-flex; align-items:center; gap:7px; }
.icon-label.center { justify-content:center; }
.user-pill { border:1px solid var(--line); background:#fff; border-radius:999px; height:40px; padding:4px 12px 4px 4px; display:flex; align-items:center; gap:8px; cursor:pointer; color:var(--text); }
.user-pill img { width:30px; height:30px; border-radius:50%; object-fit:cover; background:#edf2ff; }
.hidden { display:none !important; }
.modal { border:0; padding:0; background:transparent; color:var(--text); }
.modal::backdrop { background:rgba(15,23,42,.42); backdrop-filter: blur(4px); }
.modal-card { width:min(520px, calc(100vw - 32px)); background:rgba(255,255,255,.96); border:1px solid rgba(226,232,240,.9); border-radius:24px; box-shadow:var(--shadow); padding:24px; position:relative; display:flex; flex-direction:column; gap:14px; }
.modal-card.wide { width:min(720px, calc(100vw - 32px)); }
.modal-card.narrow { width:min(430px, calc(100vw - 32px)); text-align:center; }
.modal-card h2 { margin:0 32px 4px 0; font-size:22px; letter-spacing:-.02em; }
.modal-x { position:absolute; right:14px; top:12px; width:34px; height:34px; border:0; background:#f1f5f9; border-radius:12px; color:#334155; font-size:22px; cursor:pointer; }
.segmented { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; background:#f1f5f9; padding:6px; border-radius:16px; }
.segmented button { border:0; background:transparent; height:42px; border-radius:12px; cursor:pointer; font-weight:800; color:#64748b; }
.segmented button.active { background:#fff; color:#0f172a; box-shadow:0 8px 20px rgba(15,23,42,.08); }
.clean-select { width:100%; height:44px; border:1px solid var(--line); border-radius:14px; padding:0 40px 0 14px; background:#fff; color:#0f172a; font-weight:700; appearance:none; background-image:linear-gradient(45deg, transparent 50%, #64748b 50%),linear-gradient(135deg, #64748b 50%, transparent 50%); background-position:calc(100% - 20px) 18px, calc(100% - 14px) 18px; background-size:6px 6px, 6px 6px; background-repeat:no-repeat; }
.small-note { color:#64748b; font-size:13px; margin:0; }
.small-note button { border:0; background:transparent; color:#1d4ed8; text-decoration:underline; cursor:pointer; padding:0; font:inherit; }
.auth-tabs { display:grid; grid-template-columns:1fr 1fr; gap:8px; background:#f1f5f9; border-radius:16px; padding:6px; }
.auth-tabs button { border:0; background:transparent; height:42px; border-radius:12px; cursor:pointer; font-weight:900; color:#64748b; }
.auth-tabs button.active { background:#fff; color:#0f172a; box-shadow:0 8px 20px rgba(15,23,42,.08); }
.form-message { min-height:18px; font-size:13px; color:#ef4444; margin:0; }
.avatar-picker { border:1px dashed #cbd5e1; border-radius:18px; background:#f8fafc; height:120px; display:flex !important; align-items:center; justify-content:center; gap:14px; cursor:pointer; }
.avatar-picker input { display:none; }
.avatar-picker img { width:72px; height:72px; border-radius:50%; object-fit:cover; background:#e2e8f0; }
.share-extra { padding:14px; border:1px solid #e2e8f0; border-radius:18px; background:#f8fafc; display:flex; flex-direction:column; gap:12px; }
.search-results { max-height:180px; overflow:auto; display:flex; flex-direction:column; gap:6px; }
.search-results button { border:1px solid #e2e8f0; background:#fff; border-radius:14px; min-height:42px; padding:8px 10px; text-align:left; cursor:pointer; font-weight:800; }
.selected-users { display:flex; flex-wrap:wrap; gap:8px; }
.selected-users button { border:0; background:#e0ecff; color:#1d4ed8; border-radius:999px; padding:8px 10px; font-weight:900; cursor:pointer; }
.profile-view, .share-view { height:calc(100vh - 64px); overflow:auto; padding:28px; background:var(--bg); }
.profile-head, .share-top { max-width:1180px; margin:0 auto 20px; background:rgba(255,255,255,.88); border:1px solid var(--line); border-radius:26px; padding:22px; display:flex; align-items:center; justify-content:space-between; gap:18px; box-shadow:0 12px 34px rgba(15,23,42,.07); }
.profile-head { justify-content:flex-start; }
.profile-head img { width:86px; height:86px; border-radius:50%; object-fit:cover; background:#e2e8f0; }
.profile-head h1, .share-top h1 { margin:0; letter-spacing:-.03em; }
.profile-head p, .share-top p { margin:7px 0 0; color:#64748b; }
.profile-grid { max-width:1180px; margin:0 auto; display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:16px; }
.profile-card { border:1px solid var(--line); border-radius:22px; background:#fff; overflow:hidden; box-shadow:0 10px 26px rgba(15,23,42,.07); }
.profile-card canvas { width:100%; display:block; background:#fff; }
.profile-card-body { padding:14px; display:flex; flex-direction:column; gap:10px; }
.profile-card-body b { font-size:15px; }
.profile-card-actions { display:flex; gap:8px; }
.profile-card-actions a, .profile-card-actions button { flex:1; text-align:center; border:1px solid #dbe3ef; background:#fff; border-radius:12px; height:36px; line-height:34px; color:#0f172a; text-decoration:none; font-weight:800; cursor:pointer; }
.share-actions { display:flex; flex-wrap:wrap; gap:8px; }
.share-cards { max-width:980px; margin:0 auto; display:flex; flex-direction:column; gap:22px; align-items:center; }
.share-cards canvas { width:min(100%, 760px); height:auto; border-radius:22px; box-shadow:0 14px 38px rgba(15,23,42,.14); background:#fff; }
body.view-profile #editorView, body.view-share #editorView { display:none; }
body.view-profile #profileView, body.view-share #shareView { display:block !important; }
body.view-share .left-panel, body.view-share .right-panel, body.view-share .stage-toolbar, body.view-share .thumb-strip { display:none !important; }
body.view-share .workspace { grid-template-columns:1fr; }
body.view-share .center-stage { display:none; }
body.readonly .left-panel, body.readonly .right-panel, body.readonly .stage-toolbar { display:none !important; }
body.readonly .workspace { grid-template-columns:1fr; }
body.readonly .center-stage { padding:28px; }
@media (max-width: 760px) { .top-actions .icon-label span { display:none; } .profile-head, .share-top { align-items:flex-start; flex-direction:column; } .profile-view, .share-view { padding:16px; } }

/* patched editor/account refinements */
body.view-profile .editor-action, body.view-share .editor-action { display:none !important; }
.top-actions a, .top-actions button { text-decoration:none; }
.inline-text-editor { position:fixed; z-index:50; resize:none; border:2px solid #3563ff; border-radius:10px; padding:6px 8px; background:rgba(255,255,255,.96); box-shadow:0 18px 40px rgba(15,23,42,.18); outline:none; overflow:hidden; }
.auth-card { width:min(440px, calc(100vw - 32px)); padding:0; overflow:hidden; gap:0; }
.auth-card .modal-x { background:rgba(255,255,255,.16); color:white; z-index:2; }
.auth-hero { padding:30px 28px 24px; background:linear-gradient(135deg, #0f172a, #3563ff); color:#fff; }
.auth-logo { width:52px; height:52px; border-radius:18px; display:grid; place-items:center; background:rgba(255,255,255,.14); border:1px solid rgba(255,255,255,.24); font-weight:900; letter-spacing:-.08em; margin-bottom:16px; }
.auth-hero h2 { margin:0; font-size:23px; letter-spacing:-.04em; }
.auth-hero p { margin:8px 0 0; font-size:13px; line-height:1.45; color:rgba(255,255,255,.78); }
.auth-card .auth-tabs { margin:20px 22px 14px; }
.auth-field { margin:0 22px 12px; display:block; color:#334155; font-size:12px; font-weight:900; }
.auth-field span { display:block; margin-bottom:7px; }
.auth-field input { height:46px; background:#f8fafc; border-radius:15px; }
.auth-main-button { width:calc(100% - 44px) !important; margin:2px 22px 12px; height:46px; border-radius:15px; }
.auth-card .form-message { margin:0 22px 22px; }
.profile-head #profilePublicToggle { margin-left:auto; min-width:130px; }
.tool-grid { grid-template-columns:1fr 1fr; }
body.view-profile .profile-head { justify-content:flex-start; }
@media (max-width: 760px) { .profile-head #profilePublicToggle { margin-left:0; width:100%; } .top-actions { gap:5px; } }

/* url별 분리 페이지 및 모달 애니메이션 */
a.button-like { min-height:36px; padding:0 12px; border:1px solid var(--line); border-radius:12px; display:inline-flex; align-items:center; justify-content:center; gap:7px; color:var(--text); text-decoration:none; font-weight:800; background:rgba(255,255,255,.6); transition:transform .12s ease, box-shadow .12s ease, background .12s ease; }
a.button-like:hover { transform:translateY(-1px); box-shadow:0 8px 20px rgba(15,23,42,.08); }
.public-page { overflow:hidden; }
.public-shell { min-height:100vh; }
.public-subtitle { color:var(--muted); font-size:12px; }
.home-view, .login-page-main { flex:1; min-height:0; overflow:auto; padding:34px; }
.home-view { display:grid; grid-template-columns:minmax(320px, .95fr) minmax(300px, 1.05fr); gap:28px; align-items:center; max-width:1180px; width:100%; margin:0 auto; }
.home-hero { background:rgba(255,255,255,.72); border:1px solid rgba(223,230,241,.85); border-radius:34px; padding:46px; box-shadow:var(--shadow); backdrop-filter:blur(18px); }
.home-kicker { display:inline-flex; align-items:center; height:30px; padding:0 12px; border-radius:999px; background:#e8edff; color:#1e40af; font-size:12px; font-weight:900; letter-spacing:.06em; }
.home-hero h1 { margin:18px 0 12px; font-size:clamp(38px, 6vw, 68px); line-height:1.02; letter-spacing:-.07em; }
.home-hero p { margin:0; max-width:560px; color:#64748b; font-size:17px; line-height:1.65; }
.home-actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:28px; }
.big-cta { min-height:48px; padding:0 18px; border-radius:16px; display:inline-flex; align-items:center; justify-content:center; font-weight:900; text-decoration:none; border:1px solid var(--line); color:var(--text); background:rgba(255,255,255,.68); }
.big-cta.primary { background:var(--blue); border-color:var(--blue); color:#fff; }
.home-showcase { position:relative; min-height:560px; }
.mock-card { position:absolute; width:min(310px, 42vw); aspect-ratio:1; border-radius:34px; padding:28px; background:#fff; box-shadow:0 28px 70px rgba(15,23,42,.16); border:1px solid rgba(226,232,240,.9); display:flex; flex-direction:column; justify-content:space-between; overflow:hidden; }
.mock-card b { position:relative; z-index:1; color:#3563ff; font-weight:900; letter-spacing:.08em; }
.mock-card strong { position:relative; z-index:1; font-size:38px; line-height:1.12; letter-spacing:-.06em; }
.mock-card span { position:absolute; right:-42px; bottom:-48px; width:190px; height:190px; border-radius:54px; background:linear-gradient(135deg, rgba(53,99,255,.2), rgba(14,165,233,.16)); transform:rotate(15deg); }
.mock-card.one { left:10%; top:8%; transform:rotate(-5deg); }
.mock-card.two { right:7%; top:29%; transform:rotate(6deg); }
.mock-card.three { left:23%; bottom:4%; transform:rotate(-1deg); }
.login-page-main { display:grid; place-items:center; }
.auth-page-card { width:min(460px, calc(100vw - 32px)); border:1px solid rgba(226,232,240,.9); border-radius:30px; background:#fff; box-shadow:var(--shadow); overflow:hidden; }
.static-auth-hero { padding:34px 30px 26px; }
.static-auth-hero h1 { margin:0; font-size:26px; line-height:1.2; letter-spacing:-.05em; }
.auth-page-body { padding:22px; }
.auth-page-body .auth-tabs { margin:0 0 16px; }
.auth-page-body .auth-field { margin:0 0 13px; }
.auth-page-body .auth-main-button { width:100% !important; margin:4px 0 12px; }
.modal[open]::backdrop { animation:modalFadeIn .18s ease both; }
.modal[open] .modal-card { animation:modalPopIn .22s cubic-bezier(.2,.9,.2,1) both; }
@keyframes modalFadeIn { from { opacity:0; } to { opacity:1; } }
@keyframes modalPopIn { from { opacity:0; transform:translateY(10px) scale(.96); } to { opacity:1; transform:translateY(0) scale(1); } }
.route-profile .editor-action, .route-share .editor-action { display:none !important; }
.route-profile #editorView, .route-share #editorView { visibility:hidden; }
.route-profile.view-profile #editorView, .route-share.view-share #editorView { visibility:visible; }
@media (max-width: 860px) {
  .home-view { grid-template-columns:1fr; padding:20px; }
  .home-showcase { min-height:430px; }
  .mock-card { width:min(250px, 64vw); }
  .mock-card strong { font-size:30px; }
}
@media (max-width: 760px) { a.button-like span { display:none; } .home-view, .login-page-main { padding:18px; } .home-hero { padding:30px 24px; border-radius:26px; } }

/* final multi-page routing fixes */
.standalone-page { overflow:hidden; }
.standalone-view { display:block; }
.standalone-empty { grid-column:1 / -1; }
.page-card-animate { animation:pageCardIn .28s cubic-bezier(.2,.9,.2,1) both; }
.page-grid-animate { animation:pageGridIn .34s cubic-bezier(.2,.9,.2,1) .05s both; }
@keyframes pageCardIn { from { opacity:0; transform:translateY(10px) scale(.985); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes pageGridIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
.public-page .top-actions svg, .standalone-page .top-actions svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.home-showcase .mock-card { opacity:0; left:50%; top:50%; right:auto; bottom:auto; transform:translate(-50%,-50%) rotate(0deg) scale(.92); }
body.home-ready .mock-card { opacity:1; transition:opacity .22s ease, left .7s cubic-bezier(.2,.9,.2,1), top .7s cubic-bezier(.2,.9,.2,1), transform .7s cubic-bezier(.2,.9,.2,1); }
body.home-ready .mock-card.one { left:10%; top:8%; transform:rotate(-5deg) scale(1); transition-delay:.08s; }
body.home-ready .mock-card.two { left:auto; right:7%; top:29%; transform:rotate(6deg) scale(1); transition-delay:.18s; }
body.home-ready .mock-card.three { left:23%; top:auto; bottom:4%; transform:rotate(-1deg) scale(1); transition-delay:.28s; }
@media (prefers-reduced-motion: reduce) { .mock-card, .page-card-animate, .page-grid-animate, .modal[open] .modal-card, .modal[open]::backdrop { animation:none !important; transition:none !important; opacity:1 !important; } }

/* home login state + non-overlapping showcase fix */
a.hidden, button.hidden { display:none !important; }
.home-showcase { --mock-size:min(250px, 42vw); min-height:560px; }
.home-showcase .mock-card {
  width:var(--mock-size);
  opacity:0;
  left:50%;
  top:50%;
  right:auto;
  bottom:auto;
  transform:translate(-50%,-50%) rotate(0deg) scale(.92);
}
body.home-ready .home-showcase .mock-card {
  opacity:1;
  transition:opacity .22s ease, left .72s cubic-bezier(.2,.9,.2,1), top .72s cubic-bezier(.2,.9,.2,1), transform .72s cubic-bezier(.2,.9,.2,1);
}
body.home-ready .home-showcase .mock-card.one {
  left:0;
  top:0;
  transform:translate(0,0) rotate(-4deg) scale(1);
  transition-delay:.08s;
}
body.home-ready .home-showcase .mock-card.two {
  left:calc(100% - var(--mock-size));
  top:154px;
  right:auto;
  transform:translate(0,0) rotate(4deg) scale(1);
  transition-delay:.18s;
}
body.home-ready .home-showcase .mock-card.three {
  left:0;
  top:310px;
  bottom:auto;
  transform:translate(0,0) rotate(-1deg) scale(1);
  transition-delay:.28s;
}
@media (max-width: 860px) {
  .home-showcase { --mock-size:min(240px, 76vw); min-height:790px; }
  body.home-ready .home-showcase .mock-card.one,
  body.home-ready .home-showcase .mock-card.two,
  body.home-ready .home-showcase .mock-card.three {
    left:50%;
    transform:translateX(-50%) rotate(0deg) scale(1);
  }
  body.home-ready .home-showcase .mock-card.one { top:0; }
  body.home-ready .home-showcase .mock-card.two { top:260px; }
  body.home-ready .home-showcase .mock-card.three { top:520px; }
}

/* latest/home/AI/editor fixes */
.route-editor .tabs { grid-template-columns: repeat(5, 1fr); }
.compact-grid label { margin-top: 0; }
.inline-text-editor {
  position: fixed;
  z-index: 50;
  resize: none;
  border: 1.5px dashed rgba(53,99,255,.72);
  background: transparent;
  box-shadow: none;
  outline: none;
  overflow: hidden;
  caret-color: #2563eb;
  backdrop-filter: none;
}
.inline-text-editor:focus { background: rgba(255,255,255,.08); }
.home-view { grid-template-columns: minmax(320px, .95fr) minmax(300px, 1.05fr); }
.home-carousel { position: relative; min-height: 430px; }
.home-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(62px);
  pointer-events: none;
  transition: opacity .58s ease, transform .72s cubic-bezier(.2,.9,.2,1);
}
.home-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 2;
}
.home-slide.leaving {
  opacity: 0;
  transform: translateX(-62px);
  pointer-events: none;
}
.home-hero h1 { word-break: keep-all; overflow-wrap: normal; text-wrap: balance; max-width: min(760px, 100%); }
.home-hero h1 span { display: inline; }
.latest-slide { display: flex; flex-direction: column; justify-content: center; }
.home-latest-one { margin-top: 22px; min-height: 150px; }
.home-latest-one h2 { margin: 0; font-size: clamp(28px, 4.6vw, 52px); line-height: 1.08; letter-spacing: -.06em; word-break: keep-all; }
.latest-link-card { display: block; color: inherit; text-decoration: none; border: 1px solid rgba(226,232,240,.9); border-radius: 24px; padding: 22px; background: rgba(255,255,255,.7); box-shadow: 0 14px 36px rgba(15,23,42,.08); }
.latest-link-card span { display: block; color: #3563ff; font-weight: 900; font-size: 12px; margin-bottom: 8px; }
.latest-link-card strong { display: block; font-size: clamp(27px, 4vw, 44px); line-height: 1.14; letter-spacing: -.055em; word-break: keep-all; }
.latest-link-card em { display: inline-flex; margin-top: 16px; min-height: 34px; align-items: center; padding: 0 12px; border-radius: 999px; background: #0f172a; color: white; font-style: normal; font-weight: 900; }
.latest-view .profile-head h1 { margin: 0; font-size: clamp(32px, 5vw, 56px); letter-spacing: -.06em; }
.profile-card-body p { margin: 6px 0 0; color: var(--muted); font-size: 12px; font-weight: 800; }
.profile-card-actions button { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 10px; background: #fff1f2; color: #be123c; border-color: #fecdd3; }
#aiStatus { min-height: 20px; color: #64748b; }
#aiPrompt { min-height: 132px; }
@media (max-width: 860px) {
  .home-view { grid-template-columns: 1fr; }
  .home-carousel { min-height: 460px; }
  .home-slide { position: absolute; }
}
@media (max-width: 760px) {
  .route-editor .tabs { grid-template-columns: repeat(3, 1fr); }
  .home-carousel { min-height: 500px; }
}


/* Home CTA/buttons refinement */
.home-cta-box {
  display: inline-flex;
  margin-top: 28px;
  padding: 10px;
  border: 1px solid rgba(226,232,240,.9);
  background: rgba(255,255,255,.7);
  border-radius: 22px;
  box-shadow: 0 18px 45px rgba(15,23,42,.08);
  backdrop-filter: blur(14px);
}
.home-cta-box .home-actions { margin-top: 0; }
.home-cta-box .big-cta { min-width: 136px; justify-content:center; }
@media (max-width: 560px) {
  .home-cta-box { display:flex; width:100%; }
  .home-cta-box .home-actions { width:100%; }
  .home-cta-box .big-cta { flex:1; min-width:0; }
}
.view-top-note { color:#64748b; font-size:14px; margin-top:6px; }
.ai-card-note { margin-top:8px; color:#64748b; font-size:12px; line-height:1.45; }

/* import/profile edit additions */
.import-stack { display:grid; gap:8px; }
.profile-head-actions { margin-left:auto; display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
.profile-edit-preview { width:86px; height:86px; border-radius:28px; object-fit:cover; background:#eef2ff; border:1px solid rgba(148,163,184,.35); }
@media (max-width: 760px) { .profile-head-actions { margin-left:0; width:100%; } }

/* title/import/AI image reference refinements */
.project-title-card { border:1px solid rgba(226,232,240,.86); background:rgba(248,250,252,.86); border-radius:18px; padding:12px; margin-bottom:12px; display:grid; gap:8px; }
.project-title-card label { margin:0; font-size:12px; font-weight:900; color:#475569; }
.project-title-card input { height:42px; border-radius:14px; border:1px solid rgba(203,213,225,.95); padding:0 12px; font-weight:900; letter-spacing:-.02em; }
.labeled-colors { grid-template-columns:repeat(3,minmax(0,1fr)); }
.labeled-colors label { display:grid; gap:5px; margin:0; font-size:10px; font-weight:900; color:#64748b; }
.labeled-colors input { width:100%; min-width:0; }
.ai-image-picker { display:grid; gap:10px; }
.ai-image-ref-list { display:grid; gap:8px; max-height:220px; overflow:auto; padding-right:2px; }
.ai-image-ref { display:grid; grid-template-columns:54px minmax(0,1fr) 28px; gap:10px; align-items:center; border:1px solid rgba(226,232,240,.95); border-radius:16px; padding:8px; background:#fff; }
.ai-image-ref img { width:54px; height:54px; border-radius:13px; object-fit:cover; background:#e2e8f0; }
.ai-image-ref b { display:block; font-size:11px; margin-bottom:4px; color:#334155; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-image-ref input { height:34px; border-radius:11px; font-size:12px; }
.ai-image-ref button { border:0; border-radius:10px; background:#f1f5f9; color:#64748b; cursor:pointer; height:28px; font-size:17px; line-height:1; }
.segmented { grid-template-columns:repeat(auto-fit,minmax(70px,1fr)); }
