:root {
  color-scheme: light;
  --bg: #052700;
  --surface: #ffffff;
  --surface-strong: #f6f8f5;
  --ink: #020200;
  --muted: #4f5d50;
  --line: #d7dfd5;
  --red: #d33220;
  --gold: #e5a62f;
  --green: #2c541d;
  --forest: #052700;
  --deep: #001b00;
  --focus: rgba(229, 166, 47, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--surface-strong);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.site-header {
  min-height: 92px;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px max(20px, calc((100vw - 1120px) / 2 + 20px));
}

.site-logo {
  display: inline-flex;
  align-items: center;
}

.site-logo img {
  width: 78px;
  height: auto;
  display: block;
}

.site-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: "Changa One", Impact, fantasy;
}

.site-links a {
  color: #000;
  text-decoration: none;
  font-size: 1rem;
}

.site-links a:first-child {
  color: var(--green);
}

.admin-login-link {
  min-height: 48px;
  border: 0;
  background: #020200;
  color: #fff;
  display: inline-grid;
  place-items: center;
  padding: 0 18px;
  font-family: "Changa One", Impact, fantasy;
  font-size: 1rem;
}

.app-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 40px 20px 28px;
}

.topbar {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 32px 22px 42px;
  background:
    linear-gradient(rgba(0, 27, 0, 0.86), rgba(0, 27, 0, 0.86)),
    url("https://tajiriregion.com/wp-content/uploads/2024/01/crop-0-0-1920-1080-0-Tajiri-Website-Banner-1-768x432.png") center / cover;
  border: 1px solid rgba(246, 248, 245, 0.12);
  text-align: center;
}

.crest {
  width: min(190px, 28vw);
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.35));
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-family: "Changa One", Impact, fantasy;
  font-size: clamp(2.5rem, 7vw, 5.4rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
  color: var(--surface-strong);
  max-width: 760px;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
}

h2 {
  font-family: "Changa One", Impact, fantasy;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--surface-strong);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.22);
}

h3 {
  font-family: "Changa One", Impact, fantasy;
  font-size: 1.55rem;
  font-weight: 400;
  color: var(--green);
}

p {
  color: inherit;
  line-height: 1.45;
}

.topbar p {
  margin-top: 10px;
  color: #fff;
  font-family: "Changa One", Impact, fantasy;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.content {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.tabs {
  display: grid;
  align-self: start;
  gap: 8px;
  position: sticky;
  top: 12px;
}

.tab-button {
  min-height: 48px;
  border: 1px solid rgba(246, 248, 245, 0.22);
  border-radius: 0;
  padding: 0 14px;
  background: rgba(0, 27, 0, 0.72);
  color: #fff;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.tab-button.active {
  border-color: var(--gold);
  background: #fff;
  color: #000;
  box-shadow: 0 0 0 3px var(--focus);
}

.icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--gold);
}

.badge {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 0.72rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 16px;
}

.form-surface,
.status-surface,
.admin-contact,
.item-card,
.empty-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
}

.form-surface,
.status-surface {
  padding: 18px;
}

.form-surface {
  display: grid;
  gap: 16px;
}

.form-surface h3 {
  color: var(--green);
}

.avatar-editor {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid var(--gold);
  background: var(--deep);
  color: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 800;
  flex: 0 0 auto;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-large {
  width: 112px;
  height: 112px;
  font-size: 2rem;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

textarea {
  min-height: 92px;
  padding-top: 12px;
  resize: vertical;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.password-row .secondary-action {
  min-width: 76px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.file-picker input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-picker,
.secondary-action,
.primary-action,
.danger-action,
.success-action {
  min-height: 42px;
  border-radius: 0;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  text-decoration: none;
}

.primary-action {
  background: #020200;
  color: #fff;
}

.secondary-action,
.file-picker {
  background: var(--surface-strong);
  color: var(--ink);
  border-color: var(--line);
}

.danger-action {
  background: #fff;
  color: var(--red);
  border-color: rgba(184, 20, 28, 0.35);
}

.success-action {
  background: var(--green);
  color: #fff;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.password-recovery-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.preference-fieldset {
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
}

.preference-fieldset legend {
  color: var(--green);
  font-family: "Changa One", Impact, fantasy;
  font-size: 1.25rem;
  padding: 0 6px;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--green);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.status-surface {
  grid-column: 1 / -1;
  display: grid;
  align-content: start;
  gap: 14px;
}

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

.my-tracker-grid {
  display: grid;
  gap: 16px;
}

.tracker-section,
.request-targets,
.request-history-section {
  display: grid;
  gap: 10px;
}

.tracker-section h3,
.request-targets h3,
.request-history-section h3 {
  color: var(--surface-strong);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.request-targets {
  margin-bottom: 18px;
}

.request-detail-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
}

.wide-field {
  grid-column: 1 / -1;
}

.item-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

.item-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.person-line {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.person-line strong,
.item-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.title-tag {
  display: inline-grid;
  width: fit-content;
  min-height: 24px;
  place-items: center;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(229, 166, 47, 0.18);
  border: 1px solid rgba(229, 166, 47, 0.56);
  color: #80510a;
  font-size: 0.78rem;
  font-weight: 900;
}

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

.meta {
  min-height: 46px;
  background: var(--surface-strong);
  border-radius: 0;
  padding: 8px 10px;
}

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

.meta strong {
  display: block;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.pill {
  min-width: 84px;
  min-height: 28px;
  border-radius: 0;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(242, 171, 51, 0.18);
  color: #80510a;
}

.pill.accepted {
  background: rgba(20, 111, 76, 0.14);
  color: var(--green);
}

.pill.confirmed {
  background: rgba(20, 111, 76, 0.18);
  color: var(--green);
}

.pill.declined {
  background: rgba(184, 20, 28, 0.12);
  color: var(--red);
}

.pill.expired {
  background: var(--surface-strong);
  color: var(--muted);
}

.pill.disputed,
.pill.not_happened {
  background: rgba(229, 166, 47, 0.2);
  color: #80510a;
}

.segment-control {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--surface-strong);
  border-radius: 0;
  border: 1px solid var(--line);
}

.segment {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 26, 35, 0.12);
}

.admin-dashboard-tabs {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.admin-segment {
  min-height: 38px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-segment.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(20, 26, 35, 0.12);
}

.request-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.confirmation-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.confirmation-box p {
  color: var(--muted);
  font-size: 0.92rem;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}

.empty-box {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.inline-empty {
  min-height: 92px;
}

.admin-contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  background: var(--line);
  border-radius: 0;
}

.admin-contact div {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: var(--surface);
}

.admin-contact span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-contact strong {
  overflow-wrap: anywhere;
}

.admin-dashboard,
.admin-subsection {
  display: grid;
  gap: 16px;
}

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

.admin-export-button {
  justify-self: start;
}

.delivery-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-pill {
  min-height: 24px;
  display: inline-grid;
  place-items: center;
  padding: 2px 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
}

.readiness-card {
  border-left: 5px solid var(--gold);
}

.admin-subsection.admin-view {
  display: none;
}

.admin-subsection.admin-view.active {
  display: grid;
}

.admin-subsection h3 {
  color: var(--surface-strong);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.22);
}

.admin-login-card {
  max-width: 520px;
}

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

.admin-action-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.form-error {
  color: var(--red);
  font-weight: 900;
}

.form-success {
  color: var(--green);
  font-weight: 900;
}

.reset-fields {
  display: grid;
  gap: 16px;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 26px 14px 14px;
  }

  .topbar {
    min-height: 0;
    flex-direction: column;
  }

  .site-links {
    display: none;
  }

  .site-logo img {
    width: 58px;
  }

  .crest {
    width: min(190px, 58vw);
  }

  .content {
    grid-template-columns: 1fr;
  }

  .tabs {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .tab-button {
    min-height: 56px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 0.75rem;
    text-align: center;
  }

  .tab-button .icon {
    width: 20px;
    height: 20px;
  }

  .profile-grid,
  .admin-contact {
    grid-template-columns: 1fr;
  }

  .status-surface {
    grid-column: auto;
  }

  .section-header {
    display: grid;
  }

  .toolbar-actions {
    justify-content: stretch;
  }

  .toolbar-actions > * {
    width: 100%;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .admin-edit-grid,
  .admin-action-row,
  .admin-dashboard-tabs,
  .admin-stats-grid,
  .request-detail-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  h1 {
    font-size: 2.45rem;
  }

  .button-row,
  .request-actions,
  .profile-actions,
  .password-row {
    grid-template-columns: 1fr;
  }
}
