/* Camp Plan / Field edition. Layout and object colors remain in the editor styles. */
:root {
  font-family: var(--camp-body);
  color: var(--camp-ink);
  background: var(--camp-paper);
  color-scheme: light;
}
body { background: var(--camp-paper); }
button, input, select, textarea { color: var(--camp-ink); }
button {
  background: var(--camp-surface);
  border-color: var(--camp-line);
  border-radius: 3px;
}
button:hover {
  background: #e4dfd2;
  border-color: #9b9b89;
}
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--camp-accent);
  outline-offset: 3px;
}
input:not([type=checkbox]), select, textarea,
.equipment-notes textarea {
  background: #fcfaf5;
  border-color: var(--camp-line);
  border-radius: 3px;
  color: var(--camp-ink);
}
input:focus, select:focus, textarea:focus {
  outline-color: var(--camp-accent);
}
input[type=checkbox] { accent-color: var(--camp-olive); }
.subtle, .empty, .gear-empty, .plans-empty, .template-note,
#notes-status, #account-status, #equipment-status, #area-stats {
  color: var(--camp-muted);
}
.danger { color: #9a3928; }

/* The black document bar is shared visually with the public site. */
body > header {
  padding-inline: 24px;
  background: var(--camp-dark);
  color: var(--camp-surface);
  border-bottom: 1px solid #303329;
}
.brand {
  text-decoration: none;
  color: var(--camp-surface);
  gap: 12px;
  letter-spacing: 0;
}
.brand-wordmark {
  font: 400 30px/.9 var(--camp-display);
  letter-spacing: .8px;
  white-space: nowrap;
}
.brand-wordmark i { font-style: normal; color: #bbbca8; }
#document-bar { max-width: 760px; }
#document-title, #document-share, #workspace-nav button, #account-link,
#document-menu > summary {
  color: #f1eee6;
  background: transparent;
  border-color: #56594e;
}
#document-title:hover { color: #fff; }
#document-status { color: #c0c2b4; }
#document-save {
  color: var(--camp-dark);
  background: #e5dfc9;
  border-color: #e5dfc9;
  font-weight: 650;
}
#document-save:hover { background: #f2edda; }
#document-share:hover, #workspace-nav button:hover, #document-menu > summary:hover {
  background: #34382d;
}
#account-link { text-decoration: none; padding: 8px 4px; }
#account-link:hover { text-decoration: underline; text-underline-offset: 5px; }
#document-menu > summary { border-radius: 3px; }
.document-menu-items {
  background: var(--camp-surface);
  border-color: var(--camp-line);
  border-radius: 3px;
  color: var(--camp-ink);
  box-shadow: 0 12px 32px #17191424;
}
.document-menu-items button { color: var(--camp-ink); }
.document-menu-items #document-menu-status { color: var(--camp-muted); border-color: var(--camp-line); }

/* Equipment stays a two-line list on one scrolling surface. */
@media (min-width: 1001px) {
  main { grid-template-columns: 350px minmax(0, 1fr); }
}
#add-sidebar {
  background: var(--camp-paper);
  border-color: var(--camp-line);
  padding: 22px 20px;
  scrollbar-color: #b2b0a0 transparent;
}
.add-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.drawer-title {
  font: 650 15px/1 var(--camp-body);
  letter-spacing: -.02em;
}
.add-tabs {
  gap: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
  border-bottom: 1px solid #aaa99a;
  margin-bottom: 20px;
}
.add-tabs button {
  padding: 11px 5px 13px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  color: var(--camp-muted);
}
.add-tabs button[aria-selected=true] {
  background: transparent;
  border-color: var(--camp-ink);
  color: var(--camp-ink);
  box-shadow: none;
}
#product-search {
  background: #f8f5ed;
  border-color: #bbb9aa;
  border-radius: 2px;
  font-size: 13px;
  padding: 12px;
}
#product-categories { gap: 5px; padding-block: 12px; flex-wrap: wrap; overflow: visible; white-space: normal; }
#product-categories button {
  border-radius: 2px;
  font-size: 11px;
  background: transparent;
  border-color: var(--camp-line);
  padding: 6px 9px;
}
#product-categories button[aria-pressed=true] {
  color: var(--camp-surface);
  background: var(--camp-dark);
  border-color: var(--camp-dark);
}
.gear-heading {
  margin: 23px 0 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid #aaa99a;
}
.gear-heading h2 { font-size: 13px; color: var(--camp-ink); letter-spacing: -.2px; }
.gear-heading h2 small { color: var(--camp-muted); }
.gear-heading select {
  background: transparent;
  border: 0;
  color: var(--camp-muted);
  padding-block: 4px;
}
.gear-empty { padding: 8px 0 14px; font-size: 12px; }
.product-card {
  grid-template-columns: 42px minmax(0,1fr) auto auto;
  gap: 8px;
  padding: 13px 0;
  border-color: #d0cbbf;
}
.product-preview { width: 42px; height: 42px; border-radius: 2px; background: #f6f2e8; }
.product-copy strong { color: #262922; font-size: 13px; font-weight: 600; }
.product-copy > span { color: var(--camp-muted); font-size: 11px; }
.product-card .product-add {
  background: transparent;
  border-color: #aaa99a;
  border-radius: 2px;
  color: #34392c;
  padding: 7px 9px;
}
.product-card .product-add:hover { background: var(--camp-dark); color: #f7f4ed; }
.product-info { color: #707365; background: transparent; }
.product-info:hover, .gear-card-menu > summary:hover, .gear-card-actions button:hover { background: #dbd6c8; }
.owned-badge { color: #4c563a; background: #d8dcc9; border-radius: 2px; }
.gear-card-actions { background: var(--camp-surface); border-color: var(--camp-line); border-radius: 3px; }
#catalog-more { background: transparent; border-color: #aaa99a; padding: 11px; }
#catalog-more:hover { background: #ddd8c9; }
.draw-button, .set-card-actions > button:first-child {
  background: var(--camp-olive);
  border-color: var(--camp-olive);
  color: #fffdf4;
}
.draw-button:hover, .set-card-actions > button:first-child:hover {
  background: #3f472f;
  color: #fffdf4;
}
.set-empty { padding: 20px 0; }
.set-empty svg { opacity: .85; filter: sepia(.35); }
.set-empty p, .set-empty ol { color: var(--camp-muted); }
.set-card { border-color: var(--camp-line); border-radius: 3px; background: var(--camp-surface); }
.set-card > svg, #set-preview svg, .plan-open svg { background: #eae6d9; border-radius: 2px; }
.set-card p, .set-card small { color: var(--camp-muted); }

/* Warm drafting surface; object fills still carry category meaning. */
.canvas-wrap { background: var(--camp-canvas); }
.canvas-top { left: 18px; top: 18px; }
.site-edit {
  border-color: #c7c7b6;
  background: #faf7efed;
  border-radius: 3px;
  padding: 10px 13px;
  box-shadow: none;
}
.canvas-top span:first-child { color: #444b36; }
.status { background: #e6e2d8f2; color: #65695c; border-top: 1px solid #d6d2c6; font-size: 11px; }
#scale-bar { background: #f8f5e9db; color: #5c624e; border-radius: 0; }
#scale-line { border-color: #5c624e; }
.workspace-toolbar {
  padding: 6px;
  gap: 3px;
  background: #faf7ef;
  border-color: #bbbca9;
  border-radius: 4px;
  box-shadow: 0 6px 22px #373b2415;
}
.workspace-toolbar button { background: transparent; border-color: transparent; }
.workspace-toolbar button:hover { background: #e7e3d5; border-color: #c4c4b2; }
.toolbar-toggle span { color: #616653; border-radius: 3px; }
.toolbar-toggle input:checked + span { color: #39432a; background: #dfe3d1; border-color: #aab397; }
.toolbar-divider { border-color: var(--camp-line); }
#context-dock, .workspace > #notes-details {
  background: #faf7f0f7;
  border-color: #c4c3b3;
  border-radius: 4px;
  box-shadow: 0 6px 22px #373b2410;
}
#context-dock { padding: 14px; }
#context-dock #selection-label span, #context-more summary { color: var(--camp-muted); }
#context-more, #set-context { border-color: var(--camp-line); }
#selection-label .selection-angle { background: #e9e8db; border-color: #c4c8b3; border-radius: 2px; }
.workspace > #notes-details > summary { color: #404831; }
.sidebar-section > summary::after { color: #697158; }
.checklist-tabs { border-color: var(--camp-line); }
.checklist-tabs [aria-selected=true] { border-color: var(--camp-olive); color: #414a32; }
#checklist-panel h4, .checklist-group > summary { color: #646b57; }
.checklist-row label:has(input:checked) > span { color: #656b5c; }
#set-nudge { background: #e7eadb; border-color: #b7bfa3; border-radius: 3px; }
#object-tooltip, #document-toast { background: #292e21; border-radius: 3px; }
#object-context-menu { border-color: var(--camp-line); border-radius: 3px; background: var(--camp-surface); }
#conflict-list { background: #faf6e8ee; border-radius: 3px; }

/* Editing, saving and preparation use the same quiet paper panels. */
dialog.workspace-dialog, #auth-dialog, #object-dialog, #delete-plan-dialog, #help-dialog {
  background: var(--camp-surface);
  color: var(--camp-ink);
  border: 1px solid #b9b8a8;
  border-radius: 5px;
  box-shadow: 0 24px 90px #1a1d1835;
}
#help-dialog { width: min(620px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain; padding: clamp(18px,3vw,28px); }
#help-dialog h2 { padding-bottom: 15px; margin-bottom: 16px; border-bottom: 1px solid var(--camp-line); color: var(--camp-ink); font-size: 19px; }
#help-dialog p { font-size: 13px; line-height: 1.75; color: var(--camp-muted); overflow-wrap: anywhere; }
#help-close { color: #fffdf6; background: var(--camp-olive); border-color: var(--camp-olive); padding: 9px 18px; }
dialog::backdrop {
  background: #191e165c;
  backdrop-filter: blur(3px);
}
.dialog-heading { border-bottom: 1px solid var(--camp-line); padding-bottom: 17px; }
.dialog-heading h2 { color: #2b3024; font-size: 19px; letter-spacing: -.6px; }
.dialog-heading button { background: transparent; border-color: transparent; }
.plan-card { border-color: var(--camp-line); border-radius: 3px; background: #fbf8f0; }
.plan-card-copy > span, .plan-card-copy small { color: var(--camp-muted); }
.plan-badges > span { background: #e0e4d3; color: #4c5739; border-radius: 2px; }
.plan-row-actions { border-color: var(--camp-line); border-radius: 3px; background: var(--camp-surface); }
#browser-plans-section, .workspace-dialog hr, #help-preferences { border-color: var(--camp-line); }
#product-info-content a, #browser-plans-title, #equipment-list-details > summary,
.export-explanation > summary { color: var(--camp-accent); }
.export-explanation, #document-share-status, #plans-status, #wizard-step, #wizard-no-sets { color: var(--camp-muted); }
.wizard-choice { border-color: var(--camp-line); border-radius: 3px; }
.wizard-choice:has(input:checked) { border-color: var(--camp-olive); background: #e5e9d8; }
.wizard-choice small { color: var(--camp-muted); }
#editor-loading {
  background: var(--camp-surface);
  color: var(--camp-muted);
  border-color: var(--camp-line);
  border-radius: 3px;
}
@media (max-width: 700px) {
  body > header { height: 54px; padding-inline: 12px; gap: 14px; }
  .brand { font-size: 20px; flex-shrink: 0; }
  .brand-wordmark { font-size: 23px; letter-spacing: .3px; }
  #document-bar { gap: 6px; }
  #document-title { font-size: 12px; }
  #document-save { padding: 7px 10px; }
  #add-sidebar { width: min(360px, 94vw); padding: 20px 18px 32px; }
  #close-add-panel { background: transparent; border-color: transparent; }
  .canvas-top { top: 59px; left: 12px; right: 12px; }
  .workspace-toolbar { padding: 6px; border-radius: 5px; }
  .workspace-toolbar #open-add-panel { color: #fffdf3; background: var(--camp-olive); box-shadow: none; }
  #context-dock { border-radius: 6px; padding: 8px 10px; }
  #context-sheet-toggle { background: #e0e1d3; border-radius: 3px; }
  #context-dock #selection-label strong { font-size: 12px; }
  input:not([type=checkbox]), select, textarea, #product-search { font-size: 16px; }
  .gear-heading select { font-size: 11px; }
  #checklist-extra-form input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}

/* One canvas, quiet surrounding tools. Geometry and stored document data are unchanged. */
body > header { height: 56px; padding: 0 20px; gap: 16px; display: grid; grid-template-columns: auto minmax(0,1fr) auto; background: var(--camp-surface); color: var(--camp-ink); border: 0; }
.brand { color: var(--camp-ink); }
.brand-wordmark { font-size: 26px; }
.brand-wordmark i { color: var(--camp-olive); }
main { height: calc(100dvh - 56px); grid-template-columns: 296px minmax(0,1fr); }
#document-bar { margin-left: 0; min-width: 0; max-width: none; gap: 6px; }
.document-identity { position: static; transform: none; flex: 1; min-width: 0; display: flex; align-items: center; text-align: center; }
#document-title { color: var(--camp-ink); background: transparent; border: 0; padding: 2px 4px; font-size: 15px; max-width: 100%; }
#document-title:hover { color: var(--camp-olive); }
#document-status { color: var(--camp-muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#document-title-input { margin: 0; font-size: 15px; }
.document-identity { position: relative; }
.document-title-auto { position:absolute; right:6px; top:4px; border:0; background:var(--camp-panel,#f7f4ee); color:var(--camp-olive,#4f5b3e); padding:3px 7px; font-size:12px; text-decoration:underline; text-underline-offset:3px; min-height:26px; }
.document-title-auto[hidden] { display:none; }
.document-identity:has(.document-title-auto:not([hidden])) #document-title-input { padding-right:70px; }
#document-title.is-placeholder { color:var(--camp-muted,#77786c); font-weight:400; }
#document-save { background: var(--camp-olive); border-color: var(--camp-olive); color: #fffdf6; padding: 8px 15px; border-radius: 6px; height: 36px; font-size: 13px; }
#document-save:hover { background: #3f472f; }
#document-save > span:first-child { display: none; }
#document-share { color: var(--camp-ink); background: transparent; border: 0; padding: 8px 12px; font-size: 13px; }
#document-share:hover { background: #e9e4d8; }
#document-share.is-unsaved { color: #8a897d; }
#document-menu > summary { color: var(--camp-ink); background: transparent; border: 0; width: 34px; height: 36px; padding: 0; font-size: 23px; }
#document-menu > summary:hover { background: #e9e4d8; }
#workspace-nav { display: flex; }
#account-menu { position: relative; }
#account-menu > summary { cursor: pointer; list-style: none; width: 32px; height: 32px; background: #e1e5d5; color: #39432a; border-radius: 50%; display: grid; place-items: center; font-size: 15px; }
#account-menu > summary::-webkit-details-marker { display: none; }
.account-menu-items { position: absolute; top: calc(100% + 12px); right: 0; width: 220px; background: var(--camp-surface); padding: 8px; border-radius: 8px; box-shadow: 0 10px 35px #22251b30; }
#account-name { display: block; padding: 10px 9px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; color: var(--camp-muted); }
#account-name[hidden], #mobile-open-plans, #mobile-account { display: none!important; }
.account-menu-items button, #account-link { display: block; width: 100%; text-align: left; color: var(--camp-ink); border: 0; border-radius: 4px; background: transparent; padding: 10px 9px; font-size: 13px; }
#account-link { text-decoration: none; }
.account-menu-items button:hover, #account-link:hover { color: var(--camp-ink); background: #e9e4d8; text-decoration: none; }
#add-sidebar { padding: 14px 12px 0; background: var(--camp-surface); border: 0; }
.add-heading { display: none; }
.add-tabs { margin-bottom: 12px; border-bottom-color: #ddd7c9; }
.add-tabs button { font-size: 13px; padding: 10px 5px; }
.canvas-wrap { right: 48px; }
.status { right: 48px; padding: 0 12px; min-height: 0; background: #f7f4eedd; border: 0; pointer-events: none; }
.status:has(#status:empty) { display: none; }
.status #status { font-size: 13px; line-height: 24px; }
.workspace-rail { position: absolute; top: 0; right: 0; bottom: 0; width: 48px; z-index: 8; display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 12px; background: var(--camp-surface); }
.workspace-rail button { position: relative; width: 40px; height: 40px; padding: 10px; border: 0; border-radius: 7px; background: transparent; color: #626957; font-size: 15px; }
.workspace-rail button:hover, .workspace-rail button[aria-pressed=true] { background: #e1e5d5; color: #3f4a2e; }
.workspace-rail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
#packing-badge { position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; color: #fffaf2; background: var(--camp-accent); font-size: 13px; border-radius: 12px; }
#packing-badge[hidden] { display: none; }
.workspace > #notes-details { top: 0; right: 48px; bottom: 0; width: 300px; height: 100%; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: var(--camp-surface); box-shadow: -8px 0 18px #22251b0a; overflow: hidden; z-index: 7; }
.workspace > #notes-details:not([open]) { display: none; }
.workspace > #notes-details[open] { width: 300px; max-height: none; }
.workspace > #notes-details > summary { display: none; }
/* Absolute bounds avoid a details content wrapper's intrinsic height expanding the list. */
.workspace > #notes-details > .sidebar-section-body { position: absolute; inset: 0; padding: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.packing-panel-head { height: 58px; min-height: 58px; display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 18px; }
.packing-panel-head strong { font-size: 15px; }
.packing-panel-head output { margin-left: auto; color: var(--camp-muted); font-size: 13px; }
#packing-options { margin-left: auto; position: relative; }
#packing-options > summary { cursor: pointer; list-style: none; padding: 5px 8px; font-size: 19px; border-radius: 5px; }
#packing-options > summary::-webkit-details-marker { display: none; }
#packing-options > div { position: absolute; z-index: 2; right: 0; top: 100%; width: 170px; padding: 7px; background: #fffdf6; box-shadow: 0 6px 24px #22251b25; border-radius: 7px; }
#packing-options button { width: 100%; text-align: left; padding: 9px; border: 0; font-size: 13px; background: transparent; }
.sidebar-section-body > .checklist-tabs { flex: none; margin: 0 16px 6px; }
.sidebar-section-body > .checklist-tabs button { padding: 7px 4px; font-size: 13px; }
#close-packing { padding: 5px 8px; background: transparent; border: 0; font-size: 13px; }
#notes-details[data-panel=memo] #close-packing { margin-left: auto; }
#checklist-panel { min-height: 0; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.packing-list { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 12px; }
.checklist-row { display: flex; align-items: center; gap: 5px; padding: 0; min-height: 40px; border: 0; }
.checklist-row label { display: flex; align-items: center; gap: 8px; padding: 9px 3px; flex: 1; min-width: 0; margin: 0; }
.checklist-row label > span { float: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--camp-ink); }
.checklist-row input { flex: none; width: 16px; height: 16px; }
.checklist-row button { flex: none; width: 25px; padding: 3px; border: 0; background: transparent; color: #919185; font-size: 15px; }
.checklist-quantity { flex: none; font-size: 13px; color: var(--camp-muted); }
.checklist-row label:has(.checklist-warning) { flex-wrap: wrap; column-gap: 8px; row-gap: 2px; }
.checklist-row label:has(.checklist-warning) > span { flex: 1; }
.checklist-warning { display: block; flex-basis: 100%; margin-left: 24px; color: #8a592b; font-size: 12px; line-height: 1.4; }
#checklist-empty { margin: 12px 6px; font-size: 13px; line-height: 1.6; color: var(--camp-muted); }
#checklist-extra-form { flex: none; margin: 8px 16px 12px; padding: 0 8px; display: flex; align-items: center; gap: 5px; border: 1px solid #ded9cc; border-radius: 7px; background: #fffdf9; }
#checklist-extra-form input { flex: 1; min-width: 0; margin: 0; border: 0; padding: 11px 3px; background: transparent; font-size: 16px; }
#checklist-extra-form button { padding: 4px; border: 0; background: transparent; font-size: 15px; }
#memo-panel { flex: 1; min-height: 0; padding: 12px 16px 16px; display: flex; flex-direction: column; overflow: auto; }
#memo-panel .equipment-notes { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.workspace > #notes-details #memo-panel textarea { flex: 1; min-height: 120px; resize: none; font-size: 16px; }
#checklist-panel[hidden], #memo-panel[hidden], #packing-options[hidden] { display: none; }
#checklist-status { padding: 0 16px; font-size: 13px; }
#context-dock { z-index: 6; top: 90px; left: 12px; width: max-content; max-width: calc(100% - 72px); max-height: none; overflow: visible; display: flex; align-items: center; gap: 3px; padding: 5px 6px 5px 13px; color: #f4f1e9; background: #262720; border: 0; border-radius: 24px; box-shadow: 0 5px 20px #20241a26; }
#context-dock[hidden] { display: none; }
#context-sheet-toggle { display: none; }
#context-dock #selection-label { margin: 0 5px 0 0; padding: 0 11px 0 0; display: flex; align-items: center; gap: 7px; flex-wrap: nowrap; border-right: 1px solid #ffffff35; min-width: 0; max-width: 270px; color: inherit; overflow: hidden; }
#context-dock #selection-label strong { width: auto; min-width: 0; font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#context-dock #selection-label span { margin: 0; font-size: 13px; white-space: nowrap; color: #deded1; flex: none; }
#context-dock #selection-label .selection-name-button { color: #f4f1e9; font-size: 13px; padding: 2px 0; }
#context-dock #selection-label .selection-name-button:hover { color: #fff; }
#context-dock #selection-label .selection-angle { display: none; }
.context-primary { display: flex; gap: 0; flex: none; }
#context-dock .context-primary button { padding: 7px 9px; border: 0; border-radius: 18px; color: #f4f1e9; background: transparent; font-size: 13px; }
#context-dock .context-primary button:hover { background: #ffffff22; }
#context-dock button:disabled { opacity: .4; }
#context-more { position: relative; padding: 0; margin: 0; border: 0; flex: none; }
#context-more > summary { list-style: none; margin: 0; padding: 3px 10px; color: #f4f1e9; font-size: 19px; cursor: pointer; border-radius: 16px; }
#context-more > summary:hover { background: #ffffff22; }
#context-more > summary::-webkit-details-marker { display: none; }
.context-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 296px; max-height: min(360px,50vh); overflow: auto; color: var(--camp-ink); background: var(--camp-surface); border-radius: 9px; padding: 10px; box-shadow: 0 8px 24px #22251b26; }
#context-more .context-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
#context-more .context-grid button { padding: 5px; height: 36px; font-size: 15px; border: 0; background: #eae5d9; color: var(--camp-ink); border-radius: 5px; }
#set-context { padding: 0 0 8px; margin: 0 0 8px; border: 0; border-bottom: 1px solid #d6d0c3; }
#set-context p { margin: 0 0 5px; font-size: 13px; }
#set-context button { font-size: 13px; }
#context-dock:has(.context-menu):not([hidden]) { transform: none; }
#context-dock #selection-name-input { min-width: 70px; color: #262720; }
#toolbar-preferences-home { position: absolute; left: 16px; bottom: 16px; z-index: 5; background: #f7f4eef2; padding: 4px; border-radius: 8px; box-shadow: 0 3px 12px #22251b16; }
.toolbar-preferences { gap: 2px; }
.toolbar-toggle { margin: 0; }
.toolbar-toggle span { width: auto; height: 32px; padding: 4px 7px; display: flex; align-items: center; gap: 5px; border: 0; }
.toolbar-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.toolbar-toggle b { font-size: 12px; font-weight: 500; }
.workspace-toolbar { right: 64px; left: auto; bottom: 16px; transform: none; max-width: none; padding: 4px; border: 0; border-radius: 8px; background: #f7f4eef2; box-shadow: 0 3px 12px #22251b16; gap: 1px; overflow: visible; }
.workspace-toolbar button { width: 36px; height: 36px; padding: 6px; font-size: 17px; border-radius: 5px; }
.workspace-toolbar #undo-layout,.workspace-toolbar #redo-layout { width: 36px; padding: 6px; }
.workspace-toolbar #zoom-out,.workspace-toolbar #zoom-in,.workspace-toolbar #zoom-fit { display: block; }
.workspace-toolbar #zoom-percent { font-size: 13px; min-width: 42px; }
.workspace-toolbar .toolbar-divider { display: block; height: 18px; margin: 0 4px; }
#scale-bar { bottom: 68px; right: 64px; font-size: 13px; padding: 4px 6px; }
#conflict-details { position: absolute; z-index: 5; left: 16px; bottom: 66px; max-width: calc(100% - 80px); color: #756044; font-size: 13px; }
#conflict-details[hidden] { display: none; }
#conflict-summary { display: flex; align-items: center; gap: 7px; list-style: none; cursor: pointer; padding: 7px 10px; border: 1px solid #ddd3bd; border-radius: 7px; background: #faf7ef; box-shadow: 0 2px 8px #22251b0a; }
#conflict-summary::-webkit-details-marker { display: none; }
#conflict-summary svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.disclosure-chevron { margin-left: 4px; }
#conflict-details[open] .disclosure-chevron { transform: rotate(180deg); }
#conflict-details #conflict-list { position: absolute; left: 0; right: auto; top: auto; bottom: calc(100% + 7px); width: 300px; max-width: min(360px,calc(100vw - 80px)); max-height: min(320px,45dvh); display: flex; flex-direction: column; flex-wrap: nowrap; gap: 0; overflow: auto; padding: 5px; border: 1px solid #e1dacb; border-radius: 8px; background: var(--camp-surface); box-shadow: 0 5px 20px #22251b1c; }
#conflict-details #conflict-list button { flex: none; border: 0; border-radius: 4px; padding: 10px 9px; text-align: left; line-height: 1.5; font-size: 13px; color: #625c4c; background: transparent; overflow-wrap: anywhere; }
#conflict-details #conflict-list button:hover, #conflict-details #conflict-list button[aria-pressed=true] { background: #e9e4d8; }
#canvas-empty { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; pointer-events: none; }
#canvas-empty[hidden] { display: none; }
#canvas-empty > div { pointer-events: auto; padding: 25px 30px 22px; text-align: center; border-radius: 14px; background: #f7f4eee0; box-shadow: 0 7px 25px #26272012; backdrop-filter: blur(3px); }
#canvas-empty h2 { font-size: 15px; margin: 0 0 17px; color: var(--camp-ink); }
#canvas-empty .draw-button { font-size: 15px; border-radius: 6px; padding: 10px 20px; }
#canvas-empty .text-link { display: block; margin: 11px auto 0; padding: 2px; font-size: 13px; color: var(--camp-muted); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width:1100px) and (min-width:701px) { main { grid-template-columns:260px minmax(0,1fr); } #context-dock #selection-label { max-width:200px; } }
@media (max-width:700px) {
 body > header { height:100px; padding:4px 10px; grid-template-columns:auto minmax(0,1fr); grid-template-rows:44px 44px; gap:4px 8px; }
 body > header > .brand { grid-column:1; grid-row:1; }
 main { height:calc(100dvh - 100px); display:block; }
 .brand-wordmark { font-size:21px; }
 .document-identity { position:static; transform:none; flex:1; width:auto; min-width:0; align-items:flex-start; text-align:left; }
 #document-bar { grid-column:1/-1; grid-row:2; min-width:0; gap:6px; width:100%; }
 #document-title { display:block; font-size:13px; padding:3px 0; max-width:100%; }
 #document-status { display:none; }
 #document-save { height:40px; min-width:48px; padding:8px 12px; font-size:13px; }
 #document-save .save-label { display:inline; }
 #document-share { display:block; min-height:40px; min-width:44px; padding:8px; font-size:13px; }
 #document-menu > summary { width:44px; height:40px; }
 #workspace-nav { grid-column:2; grid-row:1; justify-self:end; display:flex!important; }
 #account-menu > summary { width:40px; height:40px; font-size:15px; }
 #add-sidebar { top:100px; bottom:0; width:min(360px,94vw); padding:14px 12px 0; }
 #add-sidebar .add-heading { display:flex; justify-content:flex-end; margin:0; height:40px; }
 #close-add-panel { display:block; width:44px; height:40px; padding:8px; font-size:16px; }
 .canvas-wrap { right:48px; }
 .canvas-top { top:12px; }
 .workspace-rail { width:48px; padding-top:9px; gap:8px; }
 .workspace-rail button { width:44px; height:44px; padding:12px; }
 .workspace > #notes-details, .workspace > #notes-details[open] { right:48px; width:min(320px,calc(100% - 48px)); max-height:none; }
 #open-add-panel { display:block; position:absolute; top:auto; bottom:72px; left:auto; right:58px; min-height:44px; padding:10px 13px; color:#fffdf4; background:var(--camp-olive); font-size:13px; border:0; border-radius:7px; box-shadow:0 3px 12px #22251b1a; }
 #toolbar-preferences-home { display:block!important; left:10px; bottom:72px; padding:0 3px; }
 .toolbar-toggle span { height:44px; min-width:48px; }
 .workspace-toolbar { left:10px; right:58px; bottom:12px; padding:3px; gap:0; justify-content:space-between; }
 .workspace-toolbar button, .workspace-toolbar #undo-layout, .workspace-toolbar #redo-layout { width:44px; padding:6px; height:44px; }
 .workspace-toolbar .toolbar-divider { margin:0 2px; }
 .workspace-toolbar #zoom-percent { min-width:37px; font-size:13px; }
 .workspace-toolbar #zoom-fit { font-size:15px; }
 #scale-bar { right:58px; bottom:126px; }
 #context-dock { display:grid; grid-template-columns:minmax(0,1fr) auto; left:10px; right:58px; top:auto; bottom:170px; width:auto; max-width:none; border-radius:13px; padding:7px 9px; gap:5px; max-height:calc(100% - 230px); overflow:visible; }
 #context-dock #selection-label { max-width:none; border:0; padding:0; margin:0; grid-column:1/-1; display:flex; align-items:center; gap:8px; }
 #context-dock #selection-label strong { flex:1; min-width:0; font-size:13px; }
 #context-dock #selection-label span { font-size:13px; }
 #context-sheet-toggle { display:none; }
 #context-dock .context-primary { justify-content:flex-start; gap:5px; }
 #context-dock .context-primary button { min-height:44px; min-width:48px; padding:8px 12px; font-size:13px; }
 #context-dock:not(.sheet-expanded) #context-duplicate { display:block; }
 #context-more { display:block!important; grid-column:auto; margin:0; padding:0; }
 #context-more > summary { display:grid!important; place-items:center; min-height:44px; min-width:44px; padding:6px 9px; }
 #context-more .context-grid button { min-height:44px; }
 #context-more .context-menu { top:auto; bottom:calc(100% + 14px); right:0; width:min(296px,calc(100vw - 72px)); max-height:40vh; }
 #context-dock:not(.sheet-expanded) #set-context { display:block; }
 #context-dock:not(.sheet-expanded) #set-context[hidden] { display:none; }
 #context-dock:not([hidden]) ~ .workspace-toolbar { bottom:12px; }
 #conflict-details { left:12px; bottom:280px; max-width:calc(100% - 70px); }
 #canvas-empty > div { padding:22px 20px 19px; margin:0 12px; }
 #canvas-empty h2 { font-size:15px; }
 .status { right:48px; }
}

.document-identity { flex-direction: column; }
#context-dock.menu-above .context-menu { top: auto; bottom: calc(100% + 10px); }
@media (max-width:700px) { #context-dock.sheet-expanded { overflow:visible; max-height:calc(100% - 180px); } }
/* Explicit menu contrast wins over the earlier document-header button palette. */
#account-menu #open-plans, #account-menu button, #account-menu a,
#account-menu button:hover, #account-menu a:hover,
#document-menu .document-menu-items button, #document-menu .document-menu-items button:hover {
 color: var(--camp-ink); background: transparent;
}
#account-menu button:hover, #account-menu a:hover,
#document-menu .document-menu-items button:hover { background:#e9e4d8; }
.workspace-toolbar #undo-layout, .workspace-toolbar #redo-layout { font-size:19px; }
.workspace-toolbar #undo-layout::before, .workspace-toolbar #redo-layout::before { content:none; }
@media (min-width:701px) {
 #context-dock.pill-compact { display:grid; grid-template-columns:minmax(0,1fr) auto; border-radius:12px; padding:7px; }
 #context-dock.pill-compact #selection-label { grid-column:1/-1; margin:0; padding:0; max-width:none; border:0; width:100%; }
 #context-dock.pill-compact #selection-label strong { flex:1; }
 #context-dock.pill-compact .context-primary button { padding:7px 6px; }
 #context-dock.pill-compact #context-more > summary { padding:3px 7px; }
 #context-dock.pill-tight { grid-template-columns:minmax(0,1fr); }
 #context-dock.pill-tight #selection-label { display:block; }
 #context-dock.pill-tight #selection-label span { display:block; overflow:hidden; text-overflow:ellipsis; }
 #context-dock.pill-tight .context-primary { display:grid; grid-template-columns:minmax(0,1fr); }
 #context-dock.pill-tight #context-more { justify-self:end; }
}
@media (min-width:1281px) {
 .workspace.packing-open .canvas-wrap { right:348px; }
 .workspace.packing-open .workspace-toolbar, .workspace.packing-open #scale-bar { right:364px; }
 .workspace.packing-open .status { right:348px; }
 .workspace.packing-open #conflict-details { max-width:calc(100% - 376px); }
}
@media (max-width:700px) {
 .workspace.packing-open > #notes-details { bottom:0; }
}
@media (min-width:701px) {
 #context-more .context-grid { grid-template-columns:repeat(auto-fit,minmax(44px,1fr)); }
 .context-menu { max-width:calc(100vw - 32px); }
 .context-menu .set-context-actions button { max-width:100%; overflow-wrap:anywhere; }
}
@media (max-width:1280px) {
 .workspace.packing-open .workspace-toolbar,
 .workspace.packing-open #toolbar-preferences-home,
 .workspace.packing-open #conflict-details,
 .workspace.packing-open #scale-bar,
 .workspace.packing-open #set-nudge,
 .workspace.packing-open .canvas-top,
 .workspace.packing-open #context-dock,
 .workspace.packing-open #open-add-panel { visibility:hidden; pointer-events:none; }
}
/* The object editor keeps automatic color and a manual swatch in the same row. */
.object-color-controls input[type=color],#gear-color{width:100%;height:38px;padding:3px;cursor:pointer}
.color-category{margin:4px 0 12px;font-size:13px;color:var(--muted,#65685c)}

/* Gallery entry and the publish dialog (갤러리에 올리기). */
#gallery-link { color: var(--camp-ink); text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 6px; white-space: nowrap; }
#gallery-link:hover { background: #e9e4d8; }
#document-share-preview { margin: 8px 0 12px; border: 1px solid #e3ded2; border-radius: 10px; overflow: hidden; background: #ded8cb; }
#document-share-preview:empty { display: none; }
#document-share-preview svg { display: block; width: 100%; height: auto; }
.share-nick { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 6px; color: var(--camp-muted); }
.share-nick b { color: var(--camp-ink); }
.share-nick button { border: 0; background: none; color: #4f5b3e; text-decoration: underline; text-underline-offset: 3px; padding: 0; font-size: 12px; cursor: pointer; }
.share-nick span { font-size: 12px; }
.share-scope { font-size: 12px; color: #5c5e54; background: #f1ede3; padding: 10px 12px; border-radius: 7px; line-height: 1.5; margin: 12px 0 0; }
.workspace-dialog [hidden] { display: none!important; }
#document-share-done[hidden], #document-share-form[hidden] { display: none; }
.share-done-title { font-size: 16px; font-weight: 700; margin: 4px 0 6px; }
.share-done-note { font-size: 13px; color: var(--camp-muted); margin: 0 0 12px; line-height: 1.6; }
#document-share-url { width: 100%; font-size: 13px; padding: 9px 10px; }
.share-open { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Consistent editing surfaces: readable fields and predictable action sizes. */
dialog:not(#auth-dialog) {
 max-height:calc(100dvh - 32px); overflow:auto; overscroll-behavior:contain;
 padding:24px; border:1px solid var(--camp-line); border-radius:14px;
 background:var(--camp-surface); color:var(--camp-ink);
 box-shadow:0 20px 64px #20211c30;
}
#object-dialog { width:min(480px,calc(100vw - 32px)); }
#delete-tent-dialog, #gear-delete-dialog { width:min(440px,calc(100vw - 32px)); }
dialog:not(#auth-dialog) h2 { font-size:20px; line-height:1.4; letter-spacing:-.5px; }
dialog:not(#auth-dialog) > h2, dialog:not(#auth-dialog) > form > h2 { margin:0 0 20px; }
dialog:not(#auth-dialog) .dialog-heading { margin-bottom:20px; padding-bottom:14px; }
dialog:not(#auth-dialog) .dialog-heading h2 { margin:0; }
dialog:not(#auth-dialog) button { min-height:40px; border-radius:7px; line-height:1.4; }
dialog:not(#auth-dialog) .dialog-heading button { flex:none; width:40px; height:40px; padding:8px; }
dialog:not(#auth-dialog) label { font-size:13px; line-height:1.5; color:#555b4c; }
dialog:not(#auth-dialog) input:not([type=checkbox]), dialog:not(#auth-dialog) select, dialog:not(#auth-dialog) textarea {
 min-height:42px; border-radius:7px; background:#fffefa; border-color:#d6d7cb;
}
dialog:not(#auth-dialog) .two { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
dialog:not(#auth-dialog) .two > * { min-width:0; }
#object-dialog .object-color-controls { grid-template-columns:minmax(0,1fr) 76px; }
#object-dialog #object-error:empty { display:none; }
dialog:not(#auth-dialog) p { line-height:1.65; overflow-wrap:anywhere; }
dialog:not(#auth-dialog) .subtle { font-size:12px; color:var(--camp-muted); }
.plans-toolbar { grid-template-columns:auto auto minmax(0,1fr) 130px; margin-bottom:16px; }
.share-nick { flex-wrap:wrap; }
.share-nick b { overflow-wrap:anywhere; }
.share-nick button { padding:6px 8px; }
#export-dialog { width:min(540px,calc(100vw - 32px)); }
#export-dialog .layout-toolbar { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
#export-dialog .layout-toolbar button {
 display:flex; flex-direction:column; align-items:flex-start; gap:8px;
 min-width:0; padding:16px 12px; text-align:left; background:#fffdf7;
}
#export-dialog .layout-toolbar button:hover { background:#e8ecdf; border-color:#a8b298; }
#export-dialog .layout-toolbar svg { width:24px; height:24px; margin-bottom:4px; fill:none; stroke:#596747; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
#export-dialog .layout-toolbar strong { font-size:13px; font-weight:650; }
#export-dialog .layout-toolbar span { font-size:12px; color:var(--camp-muted); }
#export-dialog #area-stats { margin:20px 0 12px; font-size:13px; }
#export-dialog .export-explanation > summary { padding:8px 0; font-size:13px; cursor:pointer; }
#export-dialog #open-checklist { width:100%; margin-top:16px; text-align:center; background:transparent; }
#export-dialog #equipment-status:empty { display:none; }
@media (max-width:700px) {
 dialog:not(#auth-dialog) { padding:20px; }
 dialog:not(#auth-dialog) input:not([type=checkbox]), dialog:not(#auth-dialog) select, dialog:not(#auth-dialog) textarea { font-size:16px; min-height:44px; }
 dialog:not(#auth-dialog) button { min-height:44px; }
 .plans-toolbar { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .plans-toolbar > #new-layout { grid-column:auto; }
 #gallery-link, #guest-auth-entry button { min-height:40px; display:inline-flex; align-items:center; }
 #close-packing, #packing-options > summary { min-width:40px; min-height:44px; display:grid; place-items:center; }
 #checklist-extra-form button { min-width:44px; min-height:44px; }
}
@media (max-width:360px) {
 .workspace-toolbar { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); }
 .workspace-toolbar .toolbar-divider { display:none; }
 .workspace-toolbar button, .workspace-toolbar #undo-layout, .workspace-toolbar #redo-layout { width:100%; }
 #export-dialog .layout-toolbar { gap:6px; }
 #export-dialog .layout-toolbar button { padding:12px 8px; }
}
/* Mobile sheets stay above the visual keyboard; actions remain reachable. */
@media(max-width:700px){
 dialog#document-share-dialog{position:fixed;inset:auto 0 var(--kbd,0px);margin:0;width:100%;max-width:none;max-height:calc(var(--vvh,100dvh) - 24px);overflow:auto;overscroll-behavior:contain;box-sizing:border-box;border-radius:18px 18px 0 0;padding:24px 20px 0;}
 #document-share-dialog .document-dialog-actions{position:sticky;bottom:0;margin:20px -20px 0;padding:12px 20px max(16px,env(safe-area-inset-bottom));background:var(--camp-surface);box-shadow:0 -10px 10px -6px var(--camp-surface);z-index:1;}
}
@media(max-width:700px){
 .workspace > #notes-details[open]{left:0;right:48px;width:auto}
 .document-identity,#document-bar,#workspace-nav{min-width:0}
 #notes-details .packing-item,.equipment-notes textarea{min-width:0;max-width:100%}
}

/* One mobile document row; secondary actions remain in the two menus. */
@media(max-width:700px){
 body > header{height:56px;grid-template-rows:none;grid-template-columns:auto minmax(0,1fr) auto;gap:4px;padding:4px 8px}
 body > header > .brand{grid-column:1;grid-row:1}
 .brand-wordmark{font-size:18px;letter-spacing:.3px}
 main{height:calc(100dvh - 56px)}
 #add-sidebar{top:56px}
 #document-bar{grid-column:2;grid-row:1;gap:2px}
 #workspace-nav{grid-column:3;grid-row:1;gap:0}
 #document-save{min-width:44px;height:44px;padding:8px}
 #document-menu > summary{width:44px;height:44px}
 #document-title{min-width:0;min-height:44px;text-align:center}
 #document-share,#gallery-link,#guest-auth-entry:not([hidden]){display:none!important}
 #mobile-open-plans,#mobile-account,#mobile-gallery,#mobile-document-gallery,#mobile-document-plans{display:block!important;min-height:44px;padding:10px 9px;color:var(--camp-ink);font-size:13px;text-decoration:none}
 #open-plans,#account-link{display:none}
 #account-menu > summary{min-width:44px;min-height:44px}
 #account-menu[data-guest=true] > summary{width:auto;padding:0 6px;border-radius:6px;background:transparent;font-size:13px;white-space:nowrap}
 #account-menu[data-guest=true] #account-avatar{display:none}
 #account-menu[data-guest=true] .mobile-account-label{display:inline!important}
}
