@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@500;700&family=Manrope:wght@400;600;700&display=swap');

:root {
  --bg: #f6f2ea;
  --bg-accent: #f0e3d5;
  --ink: #2a2522;
  --muted: #6d655e;
  --primary: #1f7a8c;
  --primary-dark: #15545f;
  --accent: #f4b860;
  --danger: #c0453c;
  --card: #fffdf8;
  --shadow: 0 20px 45px rgba(31, 20, 10, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #f8f2e8 0%, var(--bg-accent) 45%, var(--bg) 100%);
  min-height: 100vh;
  padding-bottom: 68px;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.app-header {
  text-align: center;
  margin-bottom: 24px;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 14px;
  color: var(--muted);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.home-buttons {
  display: grid;
  gap: 16px;
}

.big-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  font-size: 18px;
  font-weight: 700;
  border-radius: var(--radius);
  border: none;
  background: var(--card);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.big-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 50px rgba(31, 20, 10, 0.18);
}

.big-btn .icon {
  font-size: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}

.title {
  font-weight: 700;
  font-size: 18px;
}

.actions {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  margin-top: 12px;
}

.actions-inline {
  grid-template-columns: 1fr 1fr;
}

.actions a {
  text-decoration: none;
  display: block;
  text-align: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.danger-btn {
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.primary-btn {
  background: var(--primary);
  color: white;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: var(--accent);
  color: #4a2c04;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid #ded5c9;
}

.danger-btn {
  background: var(--danger);
  color: white;
}

.list {
  display: grid;
  gap: 12px;
}

.list-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: block;
  cursor: pointer;
}

.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 14px;
}

.meta-row span {
  font-weight: 700;
}

.form {
  display: grid;
  gap: 14px;
}

.form-section {
  margin-top: 6px;
  font-weight: 700;
  font-size: 16px;
  color: var(--primary-dark);
}

.accordion {
  display: grid;
  gap: 10px;
}

.accordion-header {
  border: none;
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 25px rgba(31, 20, 10, 0.08);
  font-weight: 700;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.accordion-icon {
  font-size: 14px;
  color: var(--muted);
}

.accordion-body {
  display: grid;
  gap: 14px;
  margin-top: 6px;
}

.accordion-body.hidden {
  display: none;
}

.field {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 25px rgba(31, 20, 10, 0.08);
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  border: 1px solid #ded5c9;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.field .options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-btn {
  border: 1px solid #ded5c9;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #fff;
}

.option-btn input {
  display: none;
}

.option-btn.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: rgba(31, 122, 140, 0.12);
}

.field-readonly {
  background: var(--card);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 25px rgba(31, 20, 10, 0.08);
  cursor: pointer;
}

.field-readonly .label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.field-readonly .value {
  font-weight: 700;
  font-size: 14px;
}

.field-readonly input,
.field-readonly textarea,
.field-readonly select {
  border: 1px solid #ded5c9;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  width: 100%;
}

.field-readonly textarea {
  min-height: 70px;
  resize: vertical;
}

.field-readonly input[type="checkbox"],
.field-readonly input[type="radio"] {
  width: auto;
}

.field-readonly.empty {
  opacity: 0.4;
}

.field-readonly.editing {
  opacity: 1;
  cursor: default;
}

.inline-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.inline-actions.hidden {
  display: none;
}

.inline-save {
  border: none;
  border-radius: 10px;
  padding: 8px 12px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.inline-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-unit span {
  font-weight: 700;
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--ink);
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.inline-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 10px;
  font-weight: 600;
}

.hidden {
  display: none;
}

.order {
  display: grid;
  gap: 14px;
}

.order-group {
  background: var(--card);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.order-group h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}

.order-list {
  display: grid;
  gap: 10px;
}

.order-item {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px dashed #c7b8a9;
  cursor: grab;
  font-size: 13px;
  font-weight: 600;
}

.order-item.dragging {
  opacity: 0.6;
}

.notice {
  font-size: 13px;
  color: var(--muted);
}

.summary {
  display: grid;
  gap: 12px;
}

.summary-block {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 0 12px 25px rgba(31, 20, 10, 0.08);
  font-size: 14px;
  line-height: 1.45;
}

.missing {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 480px) {
  .app {
    padding: 18px 14px 30px;
  }

  .big-btn {
    font-size: 16px;
  }
}

.quickbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 253, 248, 0.96);
  border-top: 1px solid #e6dccf;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px 10px 8px;
  box-shadow: 0 -8px 20px rgba(31, 20, 10, 0.08);
  z-index: 10;
}

.quick-btn {
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
}

.quick-icon {
  font-size: 14px;
  line-height: 1;
}
