.collage-page { background: #f5f6f4; }
.collage-shell { width: min(1440px, calc(100% - 56px)); }
.collage-intro { padding: 36px 0 24px; }
.collage-intro .eyebrow { margin: 0 0 12px; }
.collage-intro h1 { max-width: 760px; margin: 0; color: #30353e; font-size: clamp(32px, 4vw, 48px); line-height: 1.08; letter-spacing: -.055em; font-weight: 620; }
.collage-intro > p:last-child { max-width: 690px; margin: 13px 0 0; color: #687064; font-size: 15px; line-height: 1.7; }
.collage-editor { display: grid; grid-template-columns: minmax(220px, 250px) minmax(340px, 1fr) minmax(285px, 330px); align-items: start; gap: 14px; }
.collage-panel { min-width: 0; border: 1px solid #e2e5e1; border-radius: 13px; background: #fff; box-shadow: 0 3px 14px rgba(36,42,47,.035); }
.photos-panel, .settings-panel { padding: 17px 15px; }
.canvas-panel { padding: 17px 18px 15px; }
.collage-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.collage-panel-heading h2 { margin: 5px 0 0; color: #333740; font-size: 17px; font-weight: 620; letter-spacing: -.025em; }
.collage-panel-heading .section-kicker { margin: 0; color: #82897d; font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.count-badge { display: inline-flex; align-items: center; min-height: 20px; margin-left: 4px; padding: 0 7px; border-radius: 999px; background: #f0f2ef; color: #697164; font-size: 10px; font-weight: 600; vertical-align: 2px; letter-spacing: 0; }
.quiet-button { min-height: 30px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #72796f; cursor: pointer; font-size: 11px; }
.quiet-button:hover:not(:disabled) { background: #f2f3f1; color: #343a42; }
.quiet-button:disabled { color: #a5aaa3; }
.panel-hint, .limit-note { margin: 9px 0 12px; color: #737b70; font-size: 11px; line-height: 1.5; }
.upload-dropzone { min-height: 191px; padding: 18px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; border: 1px dashed #cbd1ca; border-radius: 10px; background: #fafbf9; color: #515950; text-align: center; transition: border-color .16s, background .16s, box-shadow .16s; }
.upload-dropzone.is-dragging { border-color: #69768f; background: #f1f3f8; box-shadow: 0 0 0 3px rgba(85,97,122,.08); }
.upload-icon { width: 35px; height: 35px; margin-bottom: 2px; display: grid; place-items: center; border: 1px solid #e0e4df; border-radius: 10px; background: #fff; color: #58647d; }
.upload-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.upload-dropzone strong { color: #363c41; font-size: 13px; font-weight: 650; }
.upload-dropzone > span:not(.upload-icon) { color: #71786f; font-size: 11px; }
.upload-dropzone small { max-width: 190px; color: #737b70; font-size: 10px; line-height: 1.45; }
.secondary-button { min-height: 34px; padding: 0 11px; border: 1px solid #d9dfe2; border-radius: 7px; background: #fff; color: #46516a; cursor: pointer; font-size: 11px; font-weight: 620; }
.secondary-button:hover:not(:disabled) { border-color: #abb4c3; background: #f8f9fb; }
.secondary-button:disabled { opacity: .5; }
.photo-list { margin-top: 13px; display: flex; flex-direction: column; gap: 7px; }
.photo-card { min-width: 0; padding: 7px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 8px; border: 1px solid #e7e9e6; border-radius: 9px; background: #fff; transition: border-color .16s, background .16s; }
.photo-card.is-selected { border-color: #8994aa; background: #f7f8fa; box-shadow: inset 0 0 0 1px rgba(85,97,122,.07); }
.photo-card[draggable="true"] { cursor: grab; }
.photo-card.is-dragging { opacity: .48; }
.photo-thumb-button { width: 42px; height: 42px; padding: 0; overflow: hidden; border: 0; border-radius: 6px; background: #eff1ef; cursor: pointer; }
.photo-thumb-button img { width: 100%; height: 100%; display: block; object-fit: cover; }
.photo-card-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; color: #424840; }
.photo-card-copy strong { overflow: hidden; font-size: 10px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.photo-card-copy span { color: #82897f; font-size: 9px; }
.photo-card-tools { display: flex; align-items: center; gap: 1px; }
.photo-tool { width: 27px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 5px; background: transparent; color: #68716a; cursor: pointer; font-size: 13px; }
.photo-tool:hover:not(:disabled) { background: #ecefea; color: #313943; }
.photo-tool:disabled { opacity: .32; }
.photo-tool.remove-photo { color: #976765; }
.photo-tool svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.limit-note { margin: 11px 2px 0; color: #777f75; font-size: 10px; }

.canvas-heading { padding: 0 1px 14px; }
.canvas-dimensions { padding: 5px 8px; border: 1px solid #e7e9e6; border-radius: 6px; background: #fafbf9; color: #727970; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.canvas-workspace { min-height: 555px; padding: 20px; display: grid; place-items: center; overflow: hidden; border: 1px solid #e5e8e4; border-radius: 10px; background: #f1f2ef; }
.canvas-checker { position: relative; width: 100%; min-height: 490px; display: grid; place-items: center; overflow: hidden; border-radius: 6px; background-color: #fafbf9; background-image: linear-gradient(45deg,#e9ece8 25%,transparent 25%),linear-gradient(-45deg,#e9ece8 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e9ece8 75%),linear-gradient(-45deg,transparent 75%,#e9ece8 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
#collage-canvas { max-width: 100%; max-height: min(65vh, 720px); width: auto; height: auto; display: block; box-shadow: 0 8px 24px rgba(34,40,43,.14); }
.canvas-empty { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #555d56; text-align: center; }
.canvas-empty[hidden], .canvas-busy[hidden] { display: none; }
.canvas-empty strong { margin-top: 17px; color: #414844; font-size: 14px; font-weight: 630; }
.canvas-empty p { max-width: 260px; margin: 7px 0 10px; color: #747c72; font-size: 12px; line-height: 1.55; }
.text-action { padding: 5px 7px; border: 0; background: transparent; color: #4e5b77; cursor: pointer; font-size: 12px; font-weight: 620; text-decoration: underline; text-underline-offset: 3px; }
.empty-art { width: 106px; height: 83px; padding: 9px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 5px; transform: rotate(-3deg); border: 1px solid #dfe4dd; border-radius: 9px; background: #fff; box-shadow: 0 6px 16px rgba(42,48,46,.08); }
.empty-art span { border-radius: 4px; background: linear-gradient(145deg,#dce4d8,#f3e9dd); }
.empty-art span:nth-child(2) { background: linear-gradient(145deg,#e7d6cb,#d9dfeb); }
.empty-art span:nth-child(3) { background: linear-gradient(145deg,#e9e6dc,#d5ded5); }
.empty-art span:nth-child(4) { background: linear-gradient(145deg,#d9e1e9,#f1e5d9); }
.canvas-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; background: rgba(247,248,245,.84); color: #4f5869; font-size: 12px; }
.spinner { width: 18px; height: 18px; border: 2px solid #d8dce4; border-top-color: #56627b; border-radius: 50%; animation: collage-spin .7s linear infinite; }
@keyframes collage-spin { to { transform: rotate(360deg); } }
.canvas-meta { min-height: 27px; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #757d73; font-size: 10px; }
.canvas-meta span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-message { margin-top: 8px; padding: 9px 10px; border: 1px solid #e5ded2; border-radius: 7px; background: #faf7f0; color: #6b5e47; font-size: 11px; line-height: 1.45; }
.editor-message.is-error { border-color: #ecd7d4; background: #fff8f7; color: #8a4f49; }

.settings-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; scrollbar-color: #cbd0c8 transparent; scrollbar-width: thin; }
.setting-section { margin-top: 17px; padding-top: 14px; border-top: 1px solid #edf0ec; }
.setting-section h3 { margin: 0 0 11px; color: #424940; font-size: 12px; font-weight: 650; letter-spacing: -.01em; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.template-button { min-width: 0; min-height: 67px; padding: 6px 3px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1px solid #e5e8e4; border-radius: 7px; background: #fff; color: #626a61; cursor: pointer; font-size: 9px; line-height: 1.15; }
.template-button:hover { border-color: #b8c0b6; background: #fafbf9; }
.template-button[aria-pressed="true"] { border-color: #8d98ae; background: #f6f7fa; color: #414b62; box-shadow: inset 0 0 0 1px rgba(85,97,122,.07); }
.template-art { width: 35px; height: 27px; padding: 2px; display: grid; gap: 2px; border: 1px solid #dbe0da; border-radius: 4px; background: #fafbf9; }
.template-art i { min-width: 0; min-height: 0; display: block; border-radius: 1px; background: #a8b2c6; }
.art-auto { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.art-side { grid-template-columns: 1fr 1fr; }
.art-stack { grid-template-rows: 1fr 1fr; }
.art-grid2 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.art-grid3 { grid-template-columns: repeat(3,1fr); grid-template-rows: repeat(2,1fr); }
.art-grid4 { grid-template-columns: repeat(4,1fr); grid-template-rows: repeat(2,1fr); }
.art-editorial { grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; }
.art-editorial i:first-child { grid-row: span 2; }
.art-horizontal { grid-template-columns: repeat(4,1fr); }
.art-vertical { grid-template-rows: repeat(4,1fr); }
.auto-arrange-button { width: 100%; min-height: 34px; margin-top: 8px; border: 1px solid #e0e4df; border-radius: 7px; background: #f9faf8; color: #4f5a72; cursor: pointer; font-size: 10px; font-weight: 620; }
.auto-arrange-button:hover { border-color: #b7c0cf; background: #f2f4f7; }
.control-label { min-width: 0; margin: 9px 0 5px; display: block; color: #626a61; font-size: 10px; font-weight: 580; }
.platform-label { display: flex; justify-content: space-between; align-items: center; gap: 5px; }
.platform-label span { color: #858c82; font-size: 9px; font-weight: 400; }
.control-select { width: 100%; min-width: 0; min-height: 35px; padding: 0 9px; border: 1px solid #e0e4df; border-radius: 6px; background: #fff; color: #3d4540; font-size: 11px; }
.dimension-fields { margin-top: 9px; display: grid; grid-template-columns: 1fr 13px 1fr; align-items: end; gap: 6px; }
.dimension-control { min-width: 0; display: flex; flex-direction: column; gap: 5px; color: #687066; font-size: 10px; }
.dimension-input { min-width: 0; height: 35px; padding: 0 8px; display: flex; align-items: center; gap: 5px; border: 1px solid #e0e4df; border-radius: 6px; background: #fff; color: #7d857a; }
.dimension-input:focus-within { border-color: #98a1b3; box-shadow: 0 0 0 3px rgba(85,97,122,.08); }
.dimension-input input { width: 0; min-width: 0; height: 100%; flex: 1; border: 0; outline: 0; background: transparent; color: #38413a; font-size: 12px; appearance: textfield; }
.dimension-input input::-webkit-inner-spin-button,.dimension-input input::-webkit-outer-spin-button { margin: 0; appearance: none; }
.dimension-input > span { font-size: 9px; }
.dimension-times { padding-bottom: 10px; color: #8b9288; text-align: center; }
.control-help { margin-top: 7px; display: block; color: #737c71; font-size: 9px; line-height: 1.45; }
.range-control { margin-top: 10px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; color: #646c62; font-size: 10px; }
.range-control output { color: #4d5870; font-size: 10px; font-variant-numeric: tabular-nums; }
.range-control input[type="range"] { width: 100%; height: 16px; grid-column: 1 / -1; margin: 0; accent-color: #56627b; }
.background-row { display: grid; grid-template-columns: minmax(0,1fr) 36px; align-items: end; gap: 7px; }
.background-row .control-label { grid-column: 1 / -1; margin: 0 0 -3px; }
.color-swatch-wrap { width: 36px; height: 35px; padding: 4px; border: 1px solid #e0e4df; border-radius: 6px; background: #fff; }
.color-swatch-wrap input,.border-color-input { width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }
.inline-controls { min-height: 35px; margin: 7px 0 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.canvas-border-toggle { min-height: 30px; display: flex; align-items: center; gap: 7px; color: #646c62; font-size: 10px; cursor: pointer; }
.canvas-border-toggle input { width: 14px; height: 14px; margin: 0; accent-color: #56627b; }
.inline-controls .control-label { margin: 0; }
.border-color-input { width: 36px; height: 29px; padding: 3px; border: 1px solid #e0e4df; border-radius: 6px; background: #fff; }
.crop-controls { margin-top: 12px; padding: 10px; border: 1px solid #eceeeb; border-radius: 7px; background: #fafbf9; }
.crop-controls > p { margin: 0 0 4px; display: flex; justify-content: space-between; gap: 6px; color: #525a51; font-size: 10px; font-weight: 610; }
.crop-controls > p span { overflow: hidden; color: #788075; font-size: 9px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.rotation-row { min-height: 38px; margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #646c62; font-size: 10px; }
.rotation-row .secondary-button { min-height: 31px; }
.export-section { padding-bottom: 2px; }
.export-summary { margin: 10px 0 8px; color: #6d756a; font-size: 10px; font-variant-numeric: tabular-nums; }
.download-button { min-height: 44px; margin-top: 3px; }
.export-success { margin: 8px 0 0; color: #49644f; font-size: 10px; line-height: 1.45; }
.privacy-note { margin: 10px 0 0; display: flex; gap: 6px; color: #687164; font-size: 9px; line-height: 1.5; }
.privacy-note span { color: #5d6982; }
.collage-guide, .collage-faq { max-width: 950px; padding: 46px 0 8px; }
.collage-guide > .section-kicker, .collage-faq > .section-kicker { margin: 0 0 8px; color: #82897d; font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.collage-guide h2, .collage-faq h2 { margin: 0 0 16px; color: #343941; font-size: 26px; line-height: 1.25; letter-spacing: -.04em; font-weight: 600; }
.guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 21px; }
.guide-grid article { padding-top: 13px; border-top: 1px solid #dfe3de; }
.guide-grid h3 { margin: 0 0 7px; color: #414840; font-size: 13px; font-weight: 640; }
.guide-grid p { margin: 0; color: #687064; font-size: 12px; line-height: 1.7; }
.guide-links { margin-top: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.guide-links p { width: 100%; margin: 0; color: #636b61; font-size: 11px; }
.guide-links a { padding: 7px 10px; border: 1px solid #e0e4df; border-radius: 7px; background: #fff; color: #4d5870; font-size: 10px; text-decoration: none; }
.guide-links a:hover { border-color: #aeb8c6; }
.collage-faq { padding-top: 34px; padding-bottom: 36px; }
.collage-faq details { padding: 13px 0; border-bottom: 1px solid #e1e4df; }
.collage-faq summary { color: #3f463f; cursor: pointer; font-size: 13px; font-weight: 610; }
.collage-faq details p { max-width: 760px; margin: 8px 0 0; color: #687064; font-size: 12px; line-height: 1.7; }
.collage-footer { min-height: 58px; }
.collage-footer .footer-brand { font-size: 18px; }

@media (max-width: 1120px) {
  .collage-shell { width: min(100%, calc(100% - 36px)); }
  .collage-editor { grid-template-columns: minmax(210px,.72fr) minmax(330px,1.28fr); grid-template-areas: "canvas canvas" "photos settings"; }
  .photos-panel { grid-area: photos; }
  .canvas-panel { grid-area: canvas; }
  .settings-panel { grid-area: settings; position: static; max-height: none; overflow: visible; }
  .canvas-workspace { min-height: 470px; }
  .canvas-checker { min-height: 410px; }
}
@media (max-width: 700px) {
  .collage-shell { width: calc(100% - 28px); }
  .collage-shell .topbar { height: 62px; }
  .collage-shell .brand { font-size: 19px; }
  .collage-shell .topbar-nav { gap: 10px; }
  .collage-shell .local-badge { padding: 6px 8px; font-size: 10px; }
  .collage-shell .nav-link { font-size: 11px; }
  .collage-intro { padding: 27px 0 18px; }
  .collage-intro h1 { font-size: clamp(31px, 9vw, 42px); }
  .collage-intro > p:last-child { font-size: 13px; line-height: 1.6; }
  .collage-editor { grid-template-columns: minmax(0,1fr); grid-template-areas: "canvas" "photos" "settings"; gap: 10px; }
  .canvas-panel { padding: 13px; }
  .canvas-workspace { min-height: 340px; padding: 12px; }
  .canvas-checker { min-height: 310px; }
  #collage-canvas { max-height: 52vh; }
  .canvas-meta { font-size: 9px; }
  .photos-panel, .settings-panel { padding: 15px; }
  .upload-dropzone { min-height: 165px; }
  .photo-list { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .photo-card { grid-template-columns: 38px minmax(0,1fr); }
  .photo-thumb-button { width: 38px; height: 38px; }
  .photo-card-tools { grid-column: 1 / -1; justify-content: flex-end; }
  .photo-tool { width: 33px; height: 30px; }
  .template-button { min-height: 70px; font-size: 9px; }
  .guide-grid { grid-template-columns: 1fr; gap: 15px; }
  .collage-guide { padding-top: 34px; }
  .collage-guide h2, .collage-faq h2 { font-size: 23px; }
  .collage-footer { align-items: flex-start; flex-direction: column; }
  .collage-footer .footer-nav { gap: 8px 12px; }
}
@media (max-width: 380px) {
  .collage-shell { width: calc(100% - 20px); }
  .collage-shell .local-badge { gap: 5px; padding: 6px; font-size: 9px; }
  .collage-shell .topbar-nav { gap: 7px; }
  .photo-list { grid-template-columns: 1fr; }
  .photo-card { grid-template-columns: 42px minmax(0,1fr) auto; }
  .photo-thumb-button { width: 42px; height: 42px; }
  .photo-card-tools { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .collage-page *, .collage-page *::before, .collage-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
