:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1f2523;
  --muted: #69726e;
  --line: #ddd8cf;
  --primary: #0f766e;
  --primary-strong: #115e59;
  --accent: #c2410c;
  --warning-bg: #fff7ed;
  --warning-line: #fed7aa;
  --danger: #b42318;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(31, 37, 35, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
}

a {
  color: var(--primary-strong);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.app-header {
  align-items: center;
  background: rgba(247, 245, 240, 0.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  left: 0;
  min-height: 58px;
  padding: 10px 16px;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 750;
}

.app-main {
  margin: 0 auto;
  max-width: 900px;
  padding: 16px 14px 92px;
}

.auth-main {
  display: grid;
  min-height: 100vh;
  padding: 20px;
  place-items: center;
}

.bottom-nav {
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  left: 0;
  position: fixed;
  right: 0;
  z-index: 20;
}

.bottom-nav a {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  min-height: 58px;
  padding: 12px 4px;
  text-align: center;
}

.bottom-nav a.active {
  color: var(--primary);
}

.page-header,
.detail-header {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.page-header h1,
.detail-header h1,
.login-panel h1 {
  font-size: 1.65rem;
  line-height: 1.12;
  margin: 0;
}

.subtle {
  color: var(--muted);
  margin: 0;
}

.action-row,
.button-row,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.chip-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 750;
  justify-content: center;
  min-height: 44px;
  padding: 10px 14px;
}

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

.primary-button:hover {
  background: var(--primary-strong);
}

.secondary-button,
.chip-button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.danger-button {
  background: #fff1f0;
  border-color: #f4b7b2;
  color: var(--danger);
}

.text-button {
  background: transparent;
  color: var(--primary-strong);
  min-height: 40px;
  padding-inline: 8px;
}

.full-width {
  width: 100%;
}

.card,
.login-panel,
.form-panel,
.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
  padding: 14px;
}

.login-panel,
.form-panel,
.search-panel {
  padding: 16px;
  width: 100%;
}

.login-panel {
  max-width: 420px;
}

.section {
  margin: 22px 0;
}

.section-title {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title h2,
.section h2 {
  font-size: 1.08rem;
  margin: 0;
}

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

.stack-form p,
.field-group {
  display: grid;
  gap: 6px;
  margin: 0;
}

.stack-form label,
.field-label {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.field-control,
.login-panel input {
  background: white;
  border: 1px solid #cfc8bd;
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

textarea.field-control {
  min-height: 96px;
}

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

.helptext,
.errorlist {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0;
}

.errorlist {
  color: var(--danger);
  list-style: none;
  padding: 0;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.message {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius);
  padding: 10px 12px;
}

.message.error {
  background: #fff1f0;
  border-color: #f4b7b2;
}

.warning-card {
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius);
  padding: 12px;
}

.meta-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.meta-item {
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.meta-label {
  color: var(--muted);
  display: block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.meta-value {
  display: block;
  font-weight: 750;
  margin-top: 2px;
}

.profile-row {
  align-items: center;
  display: flex;
  gap: 12px;
}

.profile-photo,
.thumb {
  background: #e8e4dc;
  border-radius: var(--radius);
  object-fit: cover;
}

.profile-photo {
  height: 78px;
  width: 78px;
}

.thumb {
  aspect-ratio: 1;
  width: 100%;
}

.photo-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.photo-tile figcaption {
  color: var(--muted);
  font-size: 0.86rem;
  padding: 8px;
}

.status-pill {
  background: #eef6f5;
  border-radius: 999px;
  color: var(--primary-strong);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 9px;
  width: fit-content;
}

.price {
  font-weight: 850;
}

.empty-state {
  color: var(--muted);
  padding: 18px 0;
}

.compact-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.compact-list li {
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.compact-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.segmented {
  background: #ece8df;
  border-radius: var(--radius);
  padding: 4px;
}

.segmented label {
  flex: 1 1 120px;
}

.segmented input {
  position: absolute;
  opacity: 0;
}

.segmented span {
  border-radius: 6px;
  display: block;
  font-weight: 800;
  padding: 10px 12px;
  text-align: center;
}

.segmented input:checked + span {
  background: white;
  color: var(--primary-strong);
}

.table-lite {
  border-collapse: collapse;
  width: 100%;
}

.table-lite th,
.table-lite td {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
  text-align: left;
}

@media (min-width: 760px) {
  .app-main {
    padding-inline: 24px;
  }

  .photo-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
