 :root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-alt: #F9FAFB;
  --surface-strong: #1C1E23;
  --text: #0F1115;
  --muted: #3A3F47;
  --muted-soft: #6B7280;
  --border: #E2E4E8;
  --accent: #D6A64B;
  --accent-hover: #E5BA69;
  --accent-dark: #8A6822;
  --focus: #8A6822;
  --success: #4B7D6E;
  --error: #A64444;
  --shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 0.75rem 2rem rgba(0, 0, 0, 0.08);
  --radius: 1rem;
  --content-width: 54rem;
}


* { box-sizing: border-box; }
html { font-size: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent-dark); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button, input, select, textarea { border-radius: 0.75rem; }
:focus-visible {
  outline: 0.2rem solid var(--focus);
  outline-offset: 0.15rem;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  background: var(--surface);
  color: #000;
  padding: 0.75rem 1rem;
  z-index: 9999;
}
.skip-link:focus { top: 1rem; }


[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 246, 248, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1rem 1rem 0.85rem;
  display: flex;
  gap: 0.9rem;
  align-items: center;
}
.brand-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--accent-dark);
  color: #F1F2F4;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 1.3rem;
}
.brand-name {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.app-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.app-main {
  flex: 1;
  max-width: var(--content-width);
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 6rem;
}
.tab-panel { display: block; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.stack > * + * { margin-top: 1rem; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
}
.empty-state { text-align: left; }
.button, .icon-button, .tab-button {
  min-height: 2.75rem;
  border: 1px solid transparent;
}
.button {
  background: var(--accent);
  color: #F1F2F4;
  padding: 0.8rem 1rem;
  font-weight: 600;
}
.button:hover { background: var(--accent-hover); }
.button--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.icon-button {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
  min-width: 2.75rem;
  padding: 0.4rem 0.75rem;
}
.icon-button--primary {
  background: var(--accent);
  color: #F1F2F4;
  border-color: var(--accent);
  font-size: 1.4rem;
}
.button-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 0.5rem;
}
th { font-weight: 700; }
tr:last-child td { border-bottom: none; }
.field, .field-grid { width: 100%; }
.field label, .fieldset legend { font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.75rem;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.help-text {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.lot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.lot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem;
}
.lot-card h3 { margin-top: 0; }
.lot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0;
}
.tag {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.9rem;
}
.contact-list {
  padding-left: 1.25rem;
  margin: 0;
}
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-button {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.25rem;
  border-radius: 0;
  border: none;
  background: var(--surface);
  color: var(--text);
}
.tab-button.is-active {
  background: var(--surface-alt);
  font-weight: 700;
}
.guide-toolbar {
  margin-bottom: 1rem;
}
.modal-dialog {
  width: min(40rem, calc(100vw - 1rem));
  border: none;
  border-radius: 1rem;
  padding: 0;
  box-shadow: var(--shadow-lg);
}
.modal-dialog::backdrop {
  background: rgba(15, 17, 21, 0.55);
}
.modal-dialog--wide {
  width: min(60rem, calc(100vw - 1rem));
}
.modal-shell {
  padding: 1rem;
  background: var(--surface);
}
.modal-head {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.modal-head h2 { margin: 0; }
.plan-list {
  display: grid;
  gap: 1rem;
}
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}
.plan-card h3 { margin-top: 0; }
.inline-menu-wrap { position: relative; }
.menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.25rem);
  width: max-content;
  min-width: 15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
  padding: 0.35rem;
}
.menu-panel button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.75rem;
}
.menu-panel button:hover,
.menu-panel button:focus-visible { background: var(--surface-alt); }

@media (max-width: 45rem) {
  .field-grid { grid-template-columns: 1fr; }
  .app-header h1 { font-size: 1.25rem; }
  .tab-button { font-size: 0.82rem; }
}


body {
  background-image: linear-gradient(180deg, rgba(214, 166, 75, 0.08) 0%, rgba(214, 166, 75, 0) 12rem);
}

.brand-mark {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  box-shadow: 0 0.5rem 1.25rem rgba(214, 166, 75, 0.25);
}

.brand-name {
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card,
.lot-card,
.plan-card,
.menu-panel,
.modal-shell,
.guide-toolbar {
  box-shadow: var(--shadow);
}

.button {
  box-shadow: 0 0.25rem 0.75rem rgba(214, 166, 75, 0.2);
}

.button--secondary {
  box-shadow: none;
}

.button:hover,
.icon-button--primary:hover {
  transform: translateY(-1px);
}

.icon-button:hover,
.tab-button:hover,
.menu-panel button:hover,
.plan-card .button:hover {
  background: var(--surface-alt);
}

.field input,
.field select,
.field textarea,
.modal-shell,
.plan-card,
.lot-card,
.card,
.guide-toolbar,
.menu-panel,
.icon-button,
.tab-bar,
.tab-button {
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.field input,
.field select,
.field textarea {
  background: var(--surface);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.tab-button:focus-visible,
.button:focus-visible,
.icon-button:focus-visible {
  box-shadow: 0 0 0 0.25rem rgba(214, 166, 75, 0.18);
}

.tag {
  background: rgba(214, 166, 75, 0.1);
  color: var(--accent-dark);
  border: 1px solid rgba(214, 166, 75, 0.25);
}

.tab-bar {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.tab-button {
  color: var(--muted);
}

.tab-button.is-active {
  background: linear-gradient(180deg, rgba(214, 166, 75, 0.18), rgba(214, 166, 75, 0.08));
  color: var(--text);
  border-top: 0.2rem solid var(--accent-dark);
}

.modal-shell {
  background: var(--surface);
}

.menu-panel button:focus-visible {
  background: rgba(214, 166, 75, 0.12);
}

.help-text {
  color: var(--muted);
}


.lot-card h3,
.lot-card p {
  margin-top: 0;
}

.lot-card-actions {
  margin-top: 0.75rem;
}

.lot-details-button {
  min-width: 8.5rem;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-button {
  min-width: 2.25rem;
  padding: 0.3rem 0.5rem;
}

.qty-input {
  width: 4.5rem;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.55rem 0.4rem;
}

.characteristics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}
.characteristics-grid div {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.75rem;
  background: var(--surface-alt);
}
.characteristics-grid dt {
  font-weight: 700;
}
.characteristics-grid dd {
  margin: 0.25rem 0 0;
}
.lot-dialog-line {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
}
.lot-dialog-title {
  margin: 0;
}

@media (max-width: 45rem) {
  .characteristics-grid {
    grid-template-columns: 1fr;
  }
}
