:root {
  color-scheme: light dark;
  --page: #f6f5f1;
  --page-2: #ece9e2;
  --surface: #fbfaf6;
  --surface-raised: #fdfbf4;
  --surface-soft: #f0eee7;
  --surface-ink: #e5e1d7;
  --ink: #151b1a;
  --ink-soft: #2d3432;
  --muted: #696f6b;
  --muted-2: #90958f;
  --line: #ddd9cf;
  --line-strong: #c8c1b4;
  --accent: #8d3f2f;
  --accent-hover: #703126;
  --accent-soft: #f0dbd5;
  --accent-line: #d6aea4;
  --danger: #9d463a;
  --success: #57735f;
  --pending: #8b8f8b;
  --busy: #3f585f;
  --radius: 8px;
  --shadow: 0 22px 58px rgba(35, 33, 28, 0.1);
  --shadow-soft: 0 12px 32px rgba(35, 33, 28, 0.07);
  --focus: 0 0 0 3px rgba(141, 63, 47, 0.2);
  font-family:
    "Noto Sans TC",
    "Noto Sans JP",
    "Hiragino Sans",
    "Yu Gothic",
    "Meiryo",
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111615;
    --page-2: #181c1a;
    --surface: #1a201e;
    --surface-raised: #202724;
    --surface-soft: #262c29;
    --surface-ink: #343a36;
    --ink: #f3f0e9;
    --ink-soft: #dedad0;
    --muted: #b1b4ae;
    --muted-2: #92968f;
    --line: #363c38;
    --line-strong: #51584f;
    --accent: #d47a66;
    --accent-hover: #ec927b;
    --accent-soft: rgba(212, 122, 102, 0.16);
    --accent-line: rgba(212, 122, 102, 0.34);
    --danger: #ef8c7a;
    --success: #9bc3a6;
    --pending: #969b95;
    --busy: #9fbcc0;
    --shadow: 0 22px 62px rgba(0, 0, 0, 0.28);
    --shadow-soft: 0 12px 34px rgba(0, 0, 0, 0.22);
    --focus: 0 0 0 3px rgba(212, 122, 102, 0.26);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 254, 250, 0.7), rgba(236, 233, 226, 0.72)),
    linear-gradient(90deg, rgba(141, 63, 47, 0.05), transparent 28%),
    repeating-linear-gradient(
      90deg,
      rgba(21, 27, 26, 0.035) 0 1px,
      transparent 1px 52px
    ),
    var(--page);
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      linear-gradient(180deg, rgba(17, 22, 21, 0.92), rgba(24, 28, 26, 0.86)),
      linear-gradient(90deg, rgba(212, 122, 102, 0.07), transparent 30%),
      repeating-linear-gradient(
        90deg,
        rgba(243, 240, 233, 0.032) 0 1px,
        transparent 1px 52px
      ),
      var(--page);
  }
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
summary,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.9;
  flex: 0 0 auto;
}

.app {
  width: min(100%, 1500px);
  min-height: 100dvh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(286px, 318px) minmax(0, 1fr);
  min-width: 0;
}

.side {
  position: sticky;
  top: 0;
  height: 100dvh;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(251, 250, 246, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: 18px 0 54px rgba(35, 33, 28, 0.05);
}

@media (prefers-color-scheme: dark) {
  .side {
    background: rgba(26, 32, 30, 0.82);
    box-shadow: 18px 0 54px rgba(0, 0, 0, 0.2);
  }
}

.side:before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--accent);
}

.brand,
.capture,
.title,
.actions,
.row,
.progress,
.meta,
.items-head,
.store,
.navlink,
.page-action {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  min-width: 0;
}

.brand > span:last-child,
.storetext,
.title > div,
.top > div:first-child {
  min-width: 0;
}

.mark,
.capicon,
.title > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  flex: 0 0 auto;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}

.capicon,
.title > span {
  background: var(--surface-soft);
  color: var(--busy);
  border-color: var(--line);
}

.brand-title,
.brand-sub {
  display: block;
}

.brand-title {
  font-size: 1.04rem;
  font-weight: 840;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.brand-sub {
  color: var(--muted);
  font-size: 0.83rem;
  margin-top: 4px;
}

.nav {
  display: grid;
  gap: 8px;
}

.navlink {
  min-height: 44px;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 760;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.navlink:hover {
  color: var(--ink);
  background: rgba(255, 254, 250, 0.58);
  border-color: var(--line);
}

.navlink.active {
  color: var(--ink);
  background: var(--surface-raised);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.capture {
  position: relative;
  min-height: 64px;
  min-width: min(100%, 282px);
  gap: 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--ink);
  color: var(--surface-raised);
  box-shadow: var(--shadow-soft);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.capture:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.capture:active {
  transform: translateY(1px);
}

.capture input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.capture .capicon {
  background: rgba(255, 254, 250, 0.12);
  color: var(--surface-raised);
  border-color: rgba(255, 254, 250, 0.2);
}

.capture strong,
.capture small {
  display: block;
  overflow-wrap: anywhere;
}

.capture strong {
  font-weight: 820;
}

.capture small {
  color: rgba(255, 254, 250, 0.72);
  margin-top: 3px;
  font-size: 0.8rem;
}

.btn,
.icon,
.primary,
.tool-button,
.quiet-action {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.34) inset;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.btn {
  width: 100%;
  justify-content: flex-start;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-weight: 740;
}

.btn:hover,
.icon:hover,
.page-action:hover,
.tool-button:hover,
.quiet-action:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.btn:active,
.icon:active,
.primary:active,
.page-action:active,
.tool-button:active,
.quiet-action:active {
  transform: translateY(1px);
}

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fdfbf4;
  font-weight: 800;
  box-shadow:
    0 12px 26px rgba(141, 63, 47, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.page-action {
  min-height: 44px;
  padding: 0 15px;
  white-space: nowrap;
}

.tool-button,
.quiet-action {
  min-height: 38px;
  padding: 0 11px;
  gap: 6px;
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
  font-size: 0.92rem;
  font-weight: 780;
}

.tool-button svg,
.quiet-action svg {
  width: 17px;
  height: 17px;
}

.tool-button:hover,
.quiet-action:hover {
  color: var(--ink);
  background: rgba(255, 254, 250, 0.7);
  border-color: var(--line);
  box-shadow: none;
}

.quiet-action {
  justify-self: start;
  border-color: var(--line);
  background: rgba(255, 254, 250, 0.42);
}

@media (prefers-color-scheme: dark) {
  .tool-button:hover,
  .quiet-action:hover {
    background: rgba(32, 39, 36, 0.86);
  }

  .quiet-action {
    background: rgba(32, 39, 36, 0.42);
  }
}

.danger {
  color: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible,
.capture:focus-within {
  outline: 0;
  box-shadow: var(--focus);
  border-color: var(--accent);
}

.icon {
  width: 42px;
  padding: 0;
}

.text {
  width: auto;
  white-space: nowrap;
}

.syncbox {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.58);
}

@media (prefers-color-scheme: dark) {
  .syncbox {
    background: rgba(32, 39, 36, 0.64);
  }
}

.sync-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.sync-head strong,
.sync-head small {
  display: block;
}

.sync-head strong {
  font-size: 0.95rem;
  line-height: 1.25;
}

.sync-head small {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.sync-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--pending);
  box-shadow: 0 0 0 4px rgba(139, 143, 139, 0.16);
}

.sync-dot[data-state="on"] {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(87, 115, 95, 0.18);
}

.sync-dot[data-state="busy"] {
  background: var(--busy);
  box-shadow: 0 0 0 4px rgba(63, 88, 95, 0.18);
}

.sync-dot[data-state="error"] {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(157, 70, 58, 0.18);
}

.sync-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  gap: 8px;
}

.sync-connect {
  min-width: 0;
  padding: 0 10px;
}

.sync-connect span,
.primary span,
.btn span,
.text span,
.page-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

.stat {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.62);
}

@media (prefers-color-scheme: dark) {
  .stat {
    background: rgba(32, 39, 36, 0.66);
  }
}

.stat:nth-child(2),
.stat:nth-child(3) {
  border-left-color: var(--line-strong);
}

.stat small,
.stat em {
  display: block;
}

.stat small {
  font-weight: 780;
}

.stat em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  margin-top: 4px;
}

.stat strong {
  font-size: 1.28rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.main {
  min-width: 0;
  padding: 38px;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.scan-top {
  align-items: center;
}

h1 {
  font-size: 2.28rem;
  line-height: 1.12;
  font-weight: 860;
}

h2 {
  font-size: 1.04rem;
  line-height: 1.35;
  font-weight: 800;
}

.statusline {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.statusline:empty {
  display: none;
}

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

.panel,
.records {
  background: rgba(255, 254, 250, 0.84);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  min-width: 0;
}

@media (prefers-color-scheme: dark) {
  .panel,
  .records {
    background: rgba(26, 32, 30, 0.88);
  }
}

.trip {
  margin-bottom: 18px;
}

.title {
  gap: 10px;
  margin-bottom: 14px;
}

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

.tripgrid {
  grid-template-columns:
    minmax(0, 1.18fr) minmax(140px, 0.58fr) minmax(140px, 0.58fr)
    auto;
  align-items: end;
}

.work {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: start;
}

.scan-panel,
.edit-panel {
  min-height: 100%;
}

.fields {
  grid-template-columns: 1.16fr 0.84fr 0.76fr;
}

label {
  min-width: 0;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
  margin-bottom: 7px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 45px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.38) inset;
}

textarea {
  display: block;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}

input[type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.summary {
  margin-top: 13px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.summary span {
  color: var(--muted);
}

.summary .status {
  color: var(--ink);
  font-weight: 820;
}

.summary strong {
  margin-left: auto;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  font-size: 1.08rem;
}

.image {
  position: relative;
  min-height: 360px;
  max-height: 58vh;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(141, 63, 47, 0.035), transparent 42%),
    var(--surface-raised);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.image img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--surface-raised);
}

.image.has img {
  display: block;
}

.image.has .empty {
  display: none;
}

.empty {
  color: var(--muted);
  display: grid;
  gap: 9px;
  place-items: center;
  text-align: center;
}

.empty svg {
  width: 44px;
  height: 44px;
  color: var(--busy);
}

.progress {
  gap: 10px;
  margin: 14px 0;
}

.track {
  height: 9px;
  flex: 1;
  background: var(--surface-ink);
  border-radius: 999px;
  overflow: hidden;
}

.track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.18s ease;
}

#pct {
  width: 48px;
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}

.ocr {
  min-height: 172px;
  resize: vertical;
  line-height: 1.58;
}

.panel-actions {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.tool-primary {
  min-height: 44px;
}

.tool-secondary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 254, 250, 0.5);
}

@media (prefers-color-scheme: dark) {
  .tool-secondary {
    background: rgba(32, 39, 36, 0.48);
  }
}

.items-head {
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 10px;
}

.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

th {
  text-align: left;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 0.82rem;
  font-weight: 800;
}

th:nth-child(2),
td:nth-child(2) {
  width: clamp(94px, 22%, 126px);
}

th:last-child,
td:last-child {
  width: 58px;
  text-align: center;
}

tr:last-child td {
  border-bottom: 0;
}

td input {
  min-height: 40px;
}

.save {
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
}

#hint {
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.records {
  box-shadow: var(--shadow);
}

.query {
  grid-template-columns:
    minmax(0, 1.18fr) minmax(140px, 0.58fr) minmax(0, 0.82fr)
    auto;
  align-items: end;
  margin-bottom: 15px;
}

.daily {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tile {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--surface-raised);
  color: var(--ink);
  text-align: left;
  transition:
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.tile:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-soft);
  transform: translateY(-1px);
}

.tile:active {
  transform: translateY(1px);
}

.tile span {
  display: block;
}

.tile .lbl {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.tile .date {
  margin-top: 8px;
  color: var(--ink-soft);
}

.tile strong {
  display: block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 1.42rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

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

.record {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-raised);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.record:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.record-main {
  min-width: 0;
}

.record-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.store {
  gap: 10px;
  min-width: 0;
}

.storemark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
  font-size: 0.78rem;
  font-weight: 840;
  flex: 0 0 auto;
}

.record h3 {
  font-size: 1.04rem;
  line-height: 1.34;
  overflow-wrap: anywhere;
}

.record-trip {
  display: inline-block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.record-total {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.record-total small {
  color: var(--muted);
  font-weight: 780;
  font-size: 0.78rem;
}

.total {
  color: var(--accent);
  font-size: 1.34rem;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
}

.meta {
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0 0 40px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta svg {
  width: 15px;
  height: 15px;
  color: var(--busy);
}

.lines {
  margin: 12px 0 0 40px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.lines .items-head {
  justify-content: space-between;
  margin: 0 0 8px;
}

.lines .items-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.itemlist {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.itemrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.itemrow:first-child {
  border-top: 0;
}

.itemname {
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.price {
  font-weight: 780;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.more {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.more summary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.more summary::-webkit-details-marker {
  display: none;
}

.more summary svg {
  width: 16px;
  height: 16px;
  transition: transform 0.18s ease;
}

.more[open] summary svg {
  transform: rotate(180deg);
}

.record-delete {
  align-self: start;
}

.emptyState {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: rgba(255, 254, 250, 0.62);
  line-height: 1.55;
}

@media (prefers-color-scheme: dark) {
  .emptyState {
    background: rgba(32, 39, 36, 0.58);
  }
}

@media (max-width: 1280px) {
  .main {
    padding: 28px;
  }

  .tripgrid {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 0.58fr) minmax(
        140px,
        0.58fr
      );
  }

  .tripgrid .primary {
    grid-column: 1/-1;
    justify-self: end;
  }

  .query {
    grid-template-columns: minmax(0, 1fr) minmax(140px, 0.58fr);
  }
}

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

  .image {
    min-height: 300px;
  }
}

@media (max-width: 1040px) {
  .app {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .side {
    position: relative;
    height: auto;
    padding: 22px;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 0.92fr);
    align-items: start;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    align-self: stretch;
  }

  .stats {
    margin-top: 0;
    grid-column: 1/-1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .syncbox {
    grid-column: 1/-1;
  }

  .tripgrid,
  .query {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tripgrid .primary {
    grid-column: auto;
    justify-self: stretch;
  }
}

@media (max-width: 760px) {
  .main {
    padding: 16px;
  }

  h1 {
    font-size: 1.82rem;
  }

  .side {
    padding: 18px 16px;
    grid-template-columns: 1fr;
  }

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

  .navlink {
    justify-content: center;
  }

  .syncbox {
    grid-column: auto;
  }

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

  .top,
  .scan-top,
  .save {
    align-items: stretch;
    flex-direction: column;
  }

  .scan-top .capture,
  .page-action {
    width: 100%;
  }

  .actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .tool-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .tool-button {
    width: 100%;
  }

  .fields,
  .tripgrid,
  .query {
    grid-template-columns: 1fr;
  }

  .image {
    min-height: 250px;
    max-height: 52vh;
  }

  .tripgrid .primary,
  .save .primary {
    width: 100%;
  }

  .summary {
    display: grid;
  }

  .summary strong {
    margin-left: 0;
  }

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

  .record-head {
    grid-template-columns: 1fr;
  }

  .record-total {
    justify-items: start;
    text-align: left;
    margin-left: 40px;
  }

  .meta,
  .lines {
    margin-left: 0;
  }

  .record-delete {
    width: 100%;
  }

  .total,
  .price {
    white-space: normal;
  }

  #hint {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .main {
    padding: 12px;
  }

  .side {
    padding: 16px 12px;
    gap: 14px;
  }

  .mark,
  .capicon,
  .title > span {
    width: 40px;
    height: 40px;
  }

  .brand-title {
    font-size: 0.98rem;
  }

  .panel,
  .records {
    padding: 14px;
  }

  .image {
    min-height: 220px;
  }

  th,
  td {
    padding: 7px 6px;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width: 92px;
  }

  th:last-child,
  td:last-child {
    width: 54px;
  }

  td input {
    min-height: 38px;
    padding: 6px 8px;
  }

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

  .record {
    padding: 12px;
  }

  .record-total {
    margin-left: 0;
  }

  .lines {
    padding: 10px;
  }
}

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

  .btn,
  .icon,
  .primary {
    min-height: 40px;
  }

  .text {
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
