@import url("https://fonts.googleapis.com/css2?family=M+PLUS+1p:wght@300;400;500;700&family=Shippori+Mincho:wght@500;700&display=swap");

:root {
  --ink: #271f17;
  --paper: #fbf4ea;
  --accent: #e16f5c;
  --accent-dark: #c45544;
  --accent-soft: #ffe2d6;
  --teal: #2a7f7e;
  --line: #e3d4c1;
  --shadow: 0 16px 40px rgba(39, 31, 23, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 20px 56px;
  font-family: "M PLUS 1p", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 10%, #fff8f0 0%, transparent 55%),
    radial-gradient(circle at 80% 0%, #fbe8db 0%, transparent 50%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.5) 0 8px, rgba(251, 244, 234, 0.3) 8px 16px),
    var(--paper);
}

.site-header {
  max-width: 1280px;
  margin: 0 auto 32px;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-kicker {
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: 12px;
  color: #7c6c5b;
  margin: 0 0 6px;
}

.brand-kicker a {
  color: inherit;
  text-decoration: none;
}

.brand-kicker a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #7c6c5b;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f6eee4;
  color: #7c6c5b;
  font-weight: 600;
  font-size: 13px;
}

.admin-email {
  font-weight: 600;
  color: var(--ink);
}

.admin-logout {
  margin-left: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #7c6c5b;
  text-decoration: none;
  font-size: 12px;
}

.admin-logout:hover {
  color: var(--ink);
  background: #f6eee4;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #7c6c5b;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.admin-email {
  font-weight: 600;
  color: var(--ink);
}

.brand-title {
  font-family: "Shippori Mincho", serif;
  font-size: 32px;
  margin: 0;
}

.brand-title a {
  color: inherit;
  text-decoration: none;
}

.brand-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.content {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 64px;
}

.site-footer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - 32px));
  margin: 0;
  padding: 4px 0 6px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  font-size: 12px;
  color: #7c6c5b;
  z-index: 80;
}

.site-footer p {
  margin: 0;
  line-height: 1.2;
}

.card {
  background: #fff;
  padding: 20px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.card h2 {
  margin: 0 0 8px;
  font-family: "Shippori Mincho", serif;
  font-size: 18px;
}

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

.form-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.form-row input {
  flex: 1;
  width: auto;
}

.form-row button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.history-toolbar {
  justify-content: space-between;
}

.history-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.history-heading h2 {
  margin-bottom: 0;
}

.history-status {
  margin: 0;
}

.history-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.history-prod-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.file-input-hidden {
  display: none !important;
}

.upload-drop-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  padding: 28px;
  border: 2px dashed #bfa486;
  border-radius: 12px;
  background: #fffdf9;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.upload-drop-zone:hover,
.upload-drop-zone:focus-visible {
  border-color: var(--accent);
  background: #fff3e8;
  outline: none;
}

.upload-drop-zone.is-dragover {
  border-color: #7db7e8;
  background: #eef7ff;
  transform: translateY(-1px);
}

.upload-drop-zone.is-disabled {
  cursor: wait;
  opacity: 0.7;
}

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

.upload-drop-sub {
  color: #7c6c5b;
  font-size: 13px;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(196, 85, 68, 0.18);
}

.schedule-page,
.schedule-admin {
  display: grid;
  gap: 14px;
}

.schedule-heading,
.schedule-admin-heading {
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.schedule-kicker {
  margin: 0 0 4px;
  color: #7c6c5b;
  font-size: 13px;
  font-weight: 700;
}

.schedule-heading h2,
.schedule-admin-heading h2 {
  margin: 0;
  font-family: "Shippori Mincho", serif;
  font-size: 28px;
}

.schedule-neighbor-months,
.schedule-admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-neighbor-months a,
.schedule-admin-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
}

.schedule-admin-tabs a.is-current {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.schedule-date-switches {
  display: grid;
  gap: 8px;
  max-width: 860px;
}

.schedule-months-note {
  margin: 0 0 4px;
  color: #7c6c5b;
  font-size: 12px;
}

.schedule-switch-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-switch-label {
  flex: 0 0 24px;
  color: #7c6c5b;
  font-weight: 700;
  font-size: 12px;
}

.schedule-segmented {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  gap: 0;
}

.schedule-segmented-years {
  display: grid;
  grid-template-columns: repeat(10, 58px);
  overflow-x: visible;
}

.schedule-segmented button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  min-width: 48px;
  padding: 5px 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  line-height: 1;
}

.schedule-segmented button:first-child {
  border-left: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
}

.schedule-segmented button:last-child {
  border-radius: 0 8px 8px 0;
}

.schedule-segmented-years button {
  border-left: 0;
  border-top: 0;
}

.schedule-segmented-years button:first-child,
.schedule-segmented-years button:last-child {
  border-radius: 0;
}

.schedule-segmented-years button:nth-child(10n + 1) {
  border-left: 1px solid var(--line);
}

.schedule-segmented-years button:nth-child(-n + 10) {
  border-top: 1px solid var(--line);
}

.schedule-segmented-years button.is-top-left {
  border-top-left-radius: 8px;
}

.schedule-segmented-years button.is-top-right {
  border-top-right-radius: 8px;
}

.schedule-segmented-years button.is-bottom-left {
  border-bottom-left-radius: 8px;
}

.schedule-segmented-years button.is-bottom-right {
  border-bottom-right-radius: 8px;
}

.schedule-segmented button.is-empty {
  opacity: 0.42;
}

.schedule-segmented button.is-placeholder {
  background: rgba(251, 244, 234, 0.72);
  color: transparent;
  cursor: default;
  opacity: 1;
  pointer-events: none;
}

.schedule-segmented button.is-empty {
  background: #fff;
}

.schedule-segmented button.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  opacity: 1;
  position: relative;
  z-index: 1;
}

.schedule-segmented button:hover {
  background: #fff8f0;
  color: var(--ink);
  transform: none;
}

.schedule-segmented button.is-current:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

.schedule-months-empty {
  color: #7c6c5b;
  font-size: 13px;
}

@media (max-width: 760px) {
  .schedule-switch-row {
    align-items: flex-start;
  }
}

.schedule-content {
  position: relative;
  min-height: 140px;
}

.schedule-list {
  display: grid;
  gap: 18px;
}

.schedule-loading-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 140px;
  background: rgba(251, 244, 234, 0.68);
  backdrop-filter: blur(2px);
  z-index: 5;
}

.schedule-loading-overlay[hidden] {
  display: none;
}

.schedule-entry {
  padding: 22px 0 24px;
  border-bottom: 1px solid var(--line);
}

.schedule-entry time {
  color: #7c6c5b;
  font-weight: 700;
  font-size: 13px;
}

.schedule-entry h3 {
  margin: 8px 0 10px;
  font-size: 20px;
}

.schedule-weather {
  margin: 8px 0 0;
  color: #7c6c5b;
}

.schedule-body {
  max-width: 760px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.schedule-body a {
  color: var(--teal);
  font-weight: 700;
}

.schedule-nowrap {
  white-space: nowrap;
}

.schedule-empty {
  padding: 32px 0;
  color: #7c6c5b;
}

.schedule-admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}

.schedule-admin-table th,
.schedule-admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.schedule-admin-table th {
  background: #fff8f0;
  font-size: 13px;
}

.schedule-admin-table tr.clickable-row {
  cursor: pointer;
}

.schedule-admin-table tr.clickable-row:hover td {
  background: #f8ffff;
}

.schedule-admin-preview {
  background: #fff;
  border: 1px solid var(--line);
  padding: 20px;
}

.schedule-admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-admin-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: #7c6c5b;
  font-size: 13px;
}

.schedule-admin-pager div {
  display: flex;
  gap: 6px;
  align-items: center;
}

.schedule-admin-pager a,
.schedule-admin-pager .is-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.schedule-admin-pager .is-current {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.button-like-secondary {
  background: #fff;
  color: var(--accent-dark);
}

.schedule-admin-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.schedule-admin-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.schedule-admin-form input[type="text"],
.schedule-admin-form input[type="datetime-local"],
.schedule-admin-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  background: #fffdf9;
}

.schedule-admin-form textarea {
  resize: vertical;
  line-height: 1.7;
}

.schedule-form-flags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.schedule-form-flags label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(360px, 640px) 1fr;
  gap: 36px;
  align-items: start;
}

.hero-media {
  position: relative;
  max-width: 640px;
}

.hero-image {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--line);
}

.hero-copy h2 {
  font-family: "Shippori Mincho", serif;
  font-size: 32px;
  margin: 8px 0 12px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--teal);
  margin: 0;
}

.lead {
  line-height: 1.8;
  font-size: 16px;
  margin: 0 0 16px;
}

.price-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 14px 16px;
}

.price-label {
  font-size: 12px;
  margin: 0;
  color: #6b5846;
}

.price {
  margin: 6px 0 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-dark);
}

.price-sub {
  margin: 6px 0 0;
  font-weight: 500;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.info-card {
  background: #fff;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.info-card h3 {
  margin: 0 0 8px;
  font-family: "Shippori Mincho", serif;
  font-size: 18px;
}

.summary {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.note {
  font-size: 14px;
  color: #7c6c5b;
  margin: 8px 0 0;
}

.note-inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.2em;
  color: var(--accent);
  vertical-align: -0.2em;
}

.note-inline-icon svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) minmax(168px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.archive-select {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
}

.archive-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.archive-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 14px;
}

.archive-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.archive-meta strong,
.archive-meta span {
  overflow-wrap: anywhere;
}

.archive-name-line strong {
  min-width: 0;
}

.archive-note {
  align-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f6eee4;
  color: #7c6c5b;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.archive-note:hover {
  background: #efe2d3;
  color: var(--ink);
}

.archive-note.archive-note-empty {
  font-style: italic !important;
  font-weight: 400;
  color: #9a8977;
}

.archive-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  color: #7c6c5b;
  font-size: 13px;
}

.archive-progress-bar {
  width: min(320px, 100%);
  height: 10px;
  overflow: hidden;
  border: 1px solid #d8c8b8;
  border-radius: 999px;
  background: #fff;
}

.archive-progress-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: #a8d84f;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.archive-progress-bar-indeterminate span {
  width: 42%;
  animation: archive-progress-slide 1.1s ease-in-out infinite;
}

@keyframes archive-progress-slide {
  0% {
    transform: translateX(-110%);
  }

  100% {
    transform: translateX(250%);
  }
}

.archive-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e7f3f3;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.archive-badge-staging {
  background: #f3ead7;
  color: #8b6732;
}

.archive-badge:hover {
  background: #d7ecec;
  color: #265c5c;
}

.archive-badge-staging:hover {
  background: #eadbbd;
  color: #6f4e20;
}

.archive-badge svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.archive-note-editor {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.archive-note-editor input {
  flex: 1 1 280px;
  min-width: min(280px, 100%);
}

.button-saving {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.button-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.archive-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font-size: 18px;
  line-height: 1;
}

.icon-button:hover {
  background: #f6eee4;
  color: var(--accent-dark);
}

.archive-download-link {
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.archive-download-link:hover {
  transform: translateY(-1px);
}

.trade-law-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}

.trade-law-table th,
.trade-law-table td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  vertical-align: top;
}

.trade-law-table th {
  width: 220px;
  background: #f7fafc;
  text-align: left;
  font-weight: 600;
  color: #2a435b;
}

.trade-law-table td {
  color: #3a4a5b;
}

label {
  font-weight: 500;
}

.address-prefix {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 14px;
}

.address-line {
  display: flex;
  gap: 8px;
  align-items: center;
}

.address-line .address-prefix {
  min-width: 20em;
}

.address-prefix {
  color: var(--ink);
  background: #f6f1ea;
  border-color: #e4d9cc;
}

.address-prefix.muted {
  background: #f6f1ea;
  color: #b7a996;
  border-color: #e4d9cc;
  opacity: 0.75;
  cursor: not-allowed;
  user-select: none;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 14px;
  background: #fff;
}

input::placeholder,
textarea::placeholder {
  color: #b7a996;
}

.input-with-clear {
  position: relative;
}

.input-with-clear input {
  padding-right: 28px;
}

.input-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #b7a996;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.input-clear:hover {
  color: var(--accent-dark);
  background: transparent;
  transform: translateY(-50%);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f6f1ea;
  color: #b7a996;
  border-color: #e4d9cc;
  opacity: 0.75;
  cursor: not-allowed;
}

.input-compact {
  max-width: 160px;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

button:disabled {
  background: #d7c7b6;
  cursor: not-allowed;
  transform: none;
}

.button-link {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.button-link:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.notice {
  background: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 12px;
  border-radius: 12px;
}

.notice.error {
  background: #f8d7da;
  border-color: #f5c6cb;
}

.orders {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 14px;
}

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

.orders th {
  text-align: center;
}

.checkbox-hit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  cursor: default;
}

.checkbox-hit input {
  margin: 0;
  cursor: default;
}

.orders input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.orders input[type="checkbox"].all-pages-mode {
  accent-color: #c44536;
}

.orders th.orders-center,
.orders td.orders-center {
  text-align: center;
}

.orders th.orders-amount {
  text-align: center;
}

.orders td.orders-amount {
  text-align: right;
}

.printed-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.sort-toggle {
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f6eee4;
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
}

.sort-toggle:hover {
  background: #efe2d6;
}

.sort-toggle:focus-visible {
  outline: 2px solid #c8b3a1;
  outline-offset: 2px;
}

.orders tbody tr {
  cursor: pointer;
}

.orders th:first-child,
.orders td:first-child {
  text-align: center;
  vertical-align: middle;
  cursor: default;
}

.orders .checkbox-cell {
  position: relative;
  width: 48px;
  padding: 0;
}

.checkbox-cell .checkbox-hit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orders th.order-id-col,
.orders td.order-id-col {
  width: 140px;
  white-space: nowrap;
}

.orders tbody tr:hover {
  background: #faf4ed;
}

.orders-form {
  padding-bottom: 140px;
}

.sticky-actions {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  width: min(1280px, calc(100% - 32px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  z-index: 90;
}

.sticky-fields {
  flex: 1;
}

.print-message-wrapper {
  position: relative;
}

.selected-summary {
  margin: 0 0 6px;
  font-size: 12px;
  color: #7c6c5b;
}

.sticky-fields textarea {
  min-height: 72px;
}

.history-toggle {
  position: absolute;
  right: 8px;
  top: -10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}

.history-toggle:hover {
  background: #f6eee4;
}

.history-panel {
  position: absolute;
  right: 0;
  left: 0;
  bottom: calc(100% + 8px);
  width: auto;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 95;
}

.history-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.history-item:hover {
  background: #f6eee4;
}

.history-date {
  display: block;
  font-size: 11px;
  color: #8b7a68;
  margin-bottom: 2px;
}

.history-text {
  display: block;
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-empty {
  font-size: 12px;
  color: #8b7a68;
  padding: 6px 8px;
}

.sticky-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button-secondary {
  background: var(--accent);
  color: #fff;
  border: none;
}

.button-secondary:hover {
  background: var(--accent-dark);
}

.button-danger {
  background: #d26a5c;
}

.button-danger:hover {
  background: #c45a4b;
}

.button-secondary:disabled,
.button-danger:disabled {
  background: #d7c7b6;
  color: #fff;
  cursor: not-allowed;
  transform: none;
}

.search-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-bottom: 10px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-field label {
  white-space: nowrap;
}

.search-year input {
  width: 72px;
}

.search-email .input-with-clear {
  width: 220px;
}

.search-order .input-with-clear {
  width: 170px;
}

.search-name input {
  width: 220px;
}

.search-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-self: center;
}

.search-actions button {
  white-space: nowrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  font-size: 13px;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.page-size-control {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #8b7a68;
  white-space: nowrap;
}

.page-size-control select {
  width: 72px;
  padding: 4px 6px;
  font-size: 12px;
}

.page-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  text-decoration: none;
  color: var(--ink);
}

.page-link:hover {
  background: #f6eee4;
}

.page-link.is-disabled {
  color: #b9a898;
  border-color: #e7ddd2;
  pointer-events: none;
}

.page-info {
  color: #7c6c5b;
}

.selection-hint a {
  color: var(--accent-dark);
  text-decoration: underline;
}

.orders-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.orders-summary .selection-hint {
  margin-left: 8px;
}

.selection-hint a:hover {
  color: var(--accent-dark);
}

.selection-hint a.is-disabled {
  color: #b9a898;
  text-decoration: none;
  pointer-events: none;
}

.detail {
  width: 100%;
  border-collapse: collapse;
}

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

.detail th {
  width: 120px;
  white-space: nowrap;
  padding-right: 6px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.status-date {
  display: inline-block;
  min-width: 19ch;
  font-size: 13px;
  color: var(--ink);
}

.status-zip {
  display: inline-block;
  min-width: 9ch;
  font-size: inherit;
  color: var(--ink);
}

.status-note {
  width: 220px;
  padding: 6px 8px;
  font-size: 13px;
}

.status-action {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.status-muted {
  color: #8b7a68;
}

.status-placeholder {
  color: #b7a996;
}

.print-block {
  display: grid;
  gap: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(21, 14, 8, 0.45);
  padding: 24px;
  z-index: 100;
}

.modal.is-open {
  display: flex;
}

.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}

.processing-overlay[hidden] {
  display: none;
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid #d8c8b8;
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-content {
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
}

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

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.modal-close {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.modal-close:hover {
  background: #f6eee4;
  transform: none;
}

.error-list {
  color: #b00020;
  padding-left: 18px;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 0.7s ease forwards;
}

.reveal:nth-of-type(2) {
  animation-delay: 0.08s;
}

.reveal:nth-of-type(3) {
  animation-delay: 0.16s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .sticky-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sticky-buttons {
    justify-content: flex-start;
  }

  .search-grid {
    flex-direction: column;
    align-items: stretch;
  }

  .search-field {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .search-field input,
  .search-field .input-with-clear {
    width: 100%;
  }

  .search-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .pagination-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination {
    justify-content: flex-start;
  }

  .price-box {
    grid-template-columns: 1fr;
  }

  .form-row {
    flex-direction: column;
  }

  .history-toolbar {
    align-items: stretch;
  }

  .history-actions {
    flex-direction: column;
  }

  .history-prod-actions {
    flex-direction: column;
    justify-content: flex-start;
  }

  .archive-row {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
  }

  .archive-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .site-header {
    padding: 12px 0 4px;
  }

  .content {
    padding-bottom: 72px;
  }

  .sticky-actions {
    bottom: 52px;
  }
}
