:root {
  --ink: #20352d;
  --muted: #68756f;
  --green: #1f6b4d;
  --green-dark: #144c38;
  --leaf: #77a96d;
  --cream: #f5f0e4;
  --paper: #fffdf8;
  --line: #d9ddd5;
  --soft: #eef2eb;
  --danger: #a64f3c;
  --shadow: 0 18px 45px rgba(31, 62, 48, 0.11);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #f8f6ef;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

.site-header {
  height: 78px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(32, 53, 45, 0.11);
  background: rgba(248, 246, 239, 0.92);
  backdrop-filter: blur(15px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--green);
  border-radius: 50% 50% 45% 55%;
  font: 700 21px Georgia, serif;
  transform: rotate(-7deg);
}
.brand > span:last-child { display: grid; line-height: 1.08; }
.brand b { font-size: 17px; letter-spacing: -0.03em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.service-status {
  padding: 6px 10px;
  border-radius: 999px;
  background: #ecece5;
  color: var(--muted);
  font-size: 12px;
}
.service-status.good { background: #e2f0e5; color: #28613f; }
.service-status.bad { background: #f7e6e1; color: #874533; }
.text-button { border: 0; background: none; font-size: 13px; text-decoration: none; cursor: pointer; }

main { overflow: hidden; }
.intro-section {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(65px, 10vw, 125px) 0 90px;
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  gap: clamp(40px, 8vw, 110px);
  align-items: center;
}
.eyebrow { color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: .19em; }
.intro-copy h1 {
  margin: 20px 0 26px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 6.2vw, 84px);
  line-height: 1.04;
  letter-spacing: -.055em;
  font-weight: 500;
}
.intro-copy h1 em { color: var(--green); font-style: italic; }
.intro-lead { max-width: 620px; margin: 0; color: #53615b; font-size: clamp(17px, 1.8vw, 21px); line-height: 1.8; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.primary-button, .secondary-button, .outline-button, .analyze-button {
  min-height: 52px;
  border-radius: 12px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--green);
  cursor: pointer;
  text-decoration: none;
  font-weight: 750;
  transition: transform .18s, background .18s, opacity .18s;
}
.primary-button { color: white; background: var(--green); box-shadow: 0 9px 25px rgba(31, 107, 77, .22); }
.primary-button:hover, .analyze-button:hover { transform: translateY(-2px); background: var(--green-dark); }
.primary-button.full { width: 100%; }
.secondary-button { background: transparent; color: var(--green); border-color: #9aafa3; }
.beta-note { margin: 17px 0 0; color: #7d837f; font-size: 12px; }

.plan-preview { position: relative; }
.plan-preview::before {
  content: "";
  position: absolute;
  inset: -80px -100px;
  background: radial-gradient(circle, rgba(122, 169, 109, .22), transparent 68%);
}
.preview-paper {
  width: 100%;
  aspect-ratio: 1.14;
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #d2d6cd;
  box-shadow: 0 30px 65px rgba(43, 68, 56, .18);
  transform: rotate(2.5deg);
}
.preview-paper::after { content: "AI CONCEPT PLAN"; position: absolute; right: 22px; bottom: 14px; font: 10px Georgia, serif; letter-spacing: .17em; color: #7a847f; }
.preview-grid {
  position: absolute;
  inset: 48px;
  border: 2px solid #64776d;
  background-image: linear-gradient(rgba(83, 112, 96, .11) 1px, transparent 1px), linear-gradient(90deg, rgba(83, 112, 96, .11) 1px, transparent 1px);
  background-size: 10% 10%;
}
.north { position: absolute; right: 20px; top: 18px; font: 700 12px Georgia, serif; }
.sample-tree, .sample-flower, .sample-stone, .sample-path {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
}
.sample-tree { width: 96px; height: 96px; color: #174d31; border: 2px solid #4b895f; border-radius: 47% 53% 42% 58%; background: repeating-radial-gradient(circle, #d8ead4 0 7px, #bcd8b8 8px 10px); }
.sample-tree.one { left: 18%; top: 19%; }
.sample-tree.two { width: 75px; height: 75px; right: 17%; top: 31%; }
.sample-flower { width: 125px; height: 58px; left: 31%; bottom: 17%; border-radius: 55%; color: #72465a; background: radial-gradient(circle at 20% 30%, #ebb1c4 0 5px, transparent 6px), radial-gradient(circle at 50% 65%, #df98b2 0 5px, transparent 6px), #f6e4ea; border: 1px dashed #bd718d; }
.sample-stone { width: 52px; height: 38px; right: 16%; bottom: 20%; background: #d5d1c9; border: 1px solid #8e8b85; border-radius: 61% 40% 55% 44%; color: #5d5b57; }
.sample-path { width: 27%; height: 48%; left: 46%; top: 43%; border: 1px dashed #9b8667; background: rgba(217, 202, 175, .48); clip-path: polygon(34% 0, 68% 0, 100% 100%, 0 100%); color: #6c5f4c; align-items: end; padding-bottom: 12px; }
.dimension { position: absolute; color: #53635b; font: 10px Georgia, serif; letter-spacing: .08em; }
.dimension.top { top: 27px; left: 41%; }
.dimension.side { left: 14px; top: 48%; transform: rotate(-90deg); }

.how-section { padding: 100px max(20px, calc((100vw - 1160px) / 2)); background: var(--ink); color: white; }
.section-heading { text-align: center; }
.section-heading .eyebrow { color: #93c799; }
.section-heading h2 { margin: 14px 0 0; font: 500 clamp(32px, 4vw, 48px) Georgia, serif; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 55px; }
.how-grid article { padding: 34px; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: rgba(255,255,255,.035); }
.how-grid article > span { display: block; color: #92c29a; font: italic 22px Georgia, serif; }
.how-grid b { display: block; margin: 18px 0 9px; font-size: 20px; }
.how-grid p { margin: 0; color: #c5cfca; font-size: 14px; }
.accuracy-callout { max-width: 920px; margin: 45px auto 0; padding: 18px 22px; border-radius: 12px; background: rgba(255,255,255,.08); color: #d7ded9; font-size: 13px; text-align: center; }

.workspace { padding: 95px max(20px, calc((100vw - 1380px) / 2)) 110px; }
.workspace-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 32px; }
.workspace-heading h2 { margin: 10px 0 4px; font: 500 clamp(33px, 4vw, 50px) Georgia, serif; }
.workspace-heading p { max-width: 720px; margin: 0; color: var(--muted); }
.workspace-tools, .export-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-button {
  padding: 9px 13px;
  border: 1px solid #c7cec7;
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.small-button:hover { border-color: var(--green); color: var(--green); }
.small-button.strong { color: white; background: var(--green); border-color: var(--green); }
.small-button.danger { color: var(--danger); }
.setup-grid { display: grid; grid-template-columns: 1.15fr 1fr .85fr; gap: 16px; align-items: stretch; }
.panel { background: white; border: 1px solid #dfe2dc; border-radius: var(--radius); box-shadow: 0 10px 35px rgba(31, 62, 48, .06); }
.setup-panel, .photo-panel, .action-panel { padding: 25px; }
.panel-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.panel-title > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font: italic 15px Georgia, serif; }
.panel-title > div { display: grid; }
.panel-title b { font-size: 17px; }
.panel-title small { color: var(--muted); font-size: 11px; }
.field { display: grid; gap: 7px; margin-bottom: 15px; }
.field > span { font-size: 12px; font-weight: 750; color: #42544b; }
.field > span small { color: #929a96; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d3d8d2;
  background: #fbfcfa;
  border-radius: 9px;
  padding: 11px 12px;
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 107, 77, .1); }
.field textarea { resize: vertical; }
.two-fields, .four-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.four-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.drop-zone {
  min-height: 164px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1.5px dashed #aab8ae;
  border-radius: 14px;
  background: #f7faf6;
  text-align: center;
  cursor: pointer;
}
.drop-zone.dragging { border-color: var(--green); background: #eaf3e9; }
.drop-zone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop-zone small { color: var(--muted); font-size: 11px; }
.drop-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: white; color: var(--green); box-shadow: 0 4px 14px rgba(31,107,77,.13); font-size: 22px; }
.photo-list { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; }
.photo-thumb { width: 76px; height: 62px; position: relative; flex: 0 0 auto; overflow: hidden; border: 1px solid #d4dad3; border-radius: 9px; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb button { position: absolute; right: 3px; top: 3px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; color: white; background: rgba(25,35,30,.75); cursor: pointer; }
.action-panel { display: flex; flex-direction: column; }
.analyze-button { width: 100%; min-height: 60px; gap: 8px; border: 0; color: white; background: var(--green); }
.analyze-button:disabled { opacity: .55; cursor: progress; transform: none; }
.outline-button { width: 100%; min-height: 46px; margin-top: 10px; color: var(--green); background: white; }
.message { display: none; margin-top: 12px; padding: 10px 12px; border-radius: 9px; font-size: 12px; white-space: pre-line; }
.message.show { display: block; background: #ecf2eb; color: #385d47; }
.message.error { background: #f8e9e5; color: #8c4636; }
.message.success { background: #e4f2e7; color: #28613d; }
.analysis-result { margin-top: 14px; padding: 14px; background: #f5f5ed; border-radius: 10px; font-size: 12px; }
.analysis-result p { margin: 6px 0; }
.analysis-result ul { margin: 7px 0 0; padding-left: 18px; color: var(--muted); }

.editor-section { margin-top: 28px; }
.editor-topbar { display: flex; justify-content: space-between; gap: 18px; align-items: center; margin-bottom: 12px; }
.view-switch { display: inline-flex; padding: 4px; border-radius: 12px; background: #dfe7df; }
.view-switch button { padding: 9px 17px; border: 0; border-radius: 9px; background: transparent; font-weight: 750; cursor: pointer; }
.view-switch button span { margin-left: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 10px; }
.view-switch button.active { color: white; background: var(--green); box-shadow: 0 4px 12px rgba(31,107,77,.24); }
.editor-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 14px; align-items: start; }
.objects-panel { padding: 20px; position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow: auto; }
.objects-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.objects-heading > div { display: grid; }
.objects-heading small { color: var(--muted); font-size: 10px; }
.objects-heading button { border: 0; padding: 7px 10px; border-radius: 8px; color: white; background: var(--green); cursor: pointer; font-size: 11px; }
.object-list { display: grid; gap: 6px; }
.empty-list { padding: 30px 15px; text-align: center; color: var(--muted); border: 1px dashed #d5dad4; border-radius: 10px; font-size: 12px; }
.object-row { display: grid; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: #f6f8f5; cursor: pointer; text-align: left; }
.object-row:hover, .object-row.active { border-color: #9bb5a4; background: #eef4ed; }
.object-row .swatch { width: 22px; height: 22px; border-radius: 50%; }
.object-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.object-row small { color: var(--muted); font-size: 9px; }
.item-form { margin-top: 15px; padding-top: 15px; border-top: 1px solid #e1e4df; }
.item-form-heading { display: flex; justify-content: space-between; margin-bottom: 12px; }
.item-form-heading button { border: 0; background: none; color: var(--danger); cursor: pointer; font-size: 11px; }
.item-form .field { margin-bottom: 9px; }
.item-form .field > span { font-size: 10px; }
.item-form .field input, .item-form .field select, .item-form .field textarea { padding: 8px; font-size: 11px; }
.drag-help { margin: 0; color: var(--muted); font-size: 10px; }
.drawing-panel { padding: 24px; min-width: 0; }
.drawing-heading { display: flex; justify-content: space-between; align-items: start; padding-bottom: 13px; border-bottom: 2px solid var(--ink); }
.drawing-heading span { color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.drawing-heading h3 { margin: 4px 0 0; font: 500 24px Georgia, serif; }
.north-label { font: 700 16px Georgia, serif; text-align: center; line-height: 1.05; }
.plan-canvas { width: 100%; min-height: 560px; display: grid; place-items: center; overflow: auto; background: #fffdf8; }
.plan-canvas svg { width: 100%; height: auto; min-width: 680px; touch-action: none; user-select: none; }
.plan-canvas [data-item-id] { cursor: grab; }
.plan-canvas [data-item-id]:active { cursor: grabbing; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 17px; padding: 11px 0; border-top: 1px solid #d4d9d2; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 9px; color: #526059; }
.legend-item i { width: 12px; height: 12px; border-radius: 50%; }
.drawing-footer { padding-top: 8px; display: flex; justify-content: space-between; border-top: 1px solid #d4d9d2; color: #78817c; font: 9px Georgia, serif; letter-spacing: .08em; }

footer { padding: 38px max(20px, calc((100vw - 1160px) / 2)); display: flex; justify-content: space-between; gap: 20px; color: #77827c; background: #ecece4; font-size: 11px; }
footer span { color: var(--green); font: 700 13px Georgia, serif; letter-spacing: .15em; }
footer p { margin: 0; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 20px; background: rgba(17, 29, 23, .6); backdrop-filter: blur(8px); }
.modal.show { display: grid; }
.modal-card { width: min(420px, 100%); position: relative; padding: 38px; border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
.modal-close { position: absolute; top: 13px; right: 15px; border: 0; background: none; font-size: 24px; cursor: pointer; color: #7c8580; }
.modal-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--green); }
.modal-card h2 { margin: 20px 0 7px; font: 500 30px Georgia, serif; }
.modal-card > p { margin: 0 0 22px; color: var(--muted); font-size: 13px; }

.loading-overlay { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 20px; background: rgba(20, 42, 31, .82); backdrop-filter: blur(10px); color: white; }
.loading-overlay.show { display: grid; }
.loading-card { max-width: 460px; text-align: center; }
.loading-card b { display: block; margin: 22px 0 8px; font: 500 26px Georgia, serif; }
.loading-card p { color: #d7e7dd; }
.loading-card small { color: #9fb7a9; }
.loader { width: 58px; height: 58px; margin: auto; border: 2px solid rgba(255,255,255,.22); border-top-color: #a8d3ac; border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1050px) {
  .intro-section { grid-template-columns: 1fr 1fr; gap: 45px; }
  .setup-grid { grid-template-columns: 1fr 1fr; }
  .action-panel { grid-column: 1 / -1; }
  .editor-grid { grid-template-columns: 290px minmax(0,1fr); }
}

@media (max-width: 780px) {
  .site-header { height: 68px; padding: 0 16px; }
  .service-status { display: none; }
  .intro-section { width: min(100% - 32px, 620px); grid-template-columns: 1fr; min-height: 0; padding: 60px 0 75px; }
  .intro-copy h1 { font-size: clamp(46px, 14vw, 68px); }
  .plan-preview { margin-top: 12px; }
  .how-section { padding-top: 75px; padding-bottom: 75px; }
  .how-grid { grid-template-columns: 1fr; }
  .workspace { padding-top: 70px; }
  .workspace-heading, .editor-topbar { align-items: flex-start; flex-direction: column; }
  .setup-grid, .editor-grid { grid-template-columns: 1fr; }
  .objects-panel { position: static; max-height: none; }
  .drawing-panel { padding: 14px; }
  .plan-canvas { min-height: 430px; justify-content: start; overflow-x: auto; }
  .plan-canvas svg { min-width: 650px; }
  .four-fields { grid-template-columns: repeat(2, minmax(0,1fr)); }
  footer { flex-direction: column; }
}

@media (max-width: 480px) {
  .brand small { display: none; }
  .text-button { font-size: 11px; }
  .intro-actions { display: grid; }
  .primary-button, .secondary-button { width: 100%; }
  .setup-panel, .photo-panel, .action-panel { padding: 19px; }
  .two-fields { grid-template-columns: 1fr; }
  .export-actions { width: 100%; }
  .export-actions .small-button { flex: 1; }
  .modal-card { padding: 28px 22px; }
}

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: white; }
  body > * { display: none !important; }
  body.printing main, body.printing #workspace, body.printing #editorSection, body.printing .editor-grid, body.printing .plan-print-area { display: block !important; }
  body.printing main { overflow: visible; }
  body.printing .intro-section, body.printing .how-section { display: none !important; }
  body.printing #workspace { padding: 0; }
  body.printing .workspace-heading, body.printing .setup-grid, body.printing .editor-topbar, body.printing .objects-panel { display: none !important; }
  body.printing .drawing-panel { border: 0; box-shadow: none; padding: 0; }
  body.printing .plan-canvas { min-height: 0; }
  body.printing .plan-canvas svg { width: 100%; min-width: 0; }
}
