:root {
  color-scheme: light;
  --bg: #eef1ec;
  --panel: #ffffff;
  --panel-2: #f7f8f5;
  --ink: #202622;
  --muted: #6d756f;
  --line: #dce2da;
  --green: #1f7a50;
  --green-soft: #e1f4e9;
  --red: #b43b35;
  --red-soft: #fae6e3;
  --amber: #a56b1c;
  --amber-soft: #fff1d2;
  --blue: #226f8f;
  --blue-soft: #e2f0f5;
  --shadow: 0 16px 34px rgba(32, 38, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(238, 241, 236, 0.92);
  padding: 24px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.login-card input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 0 12px;
}

.desktop-app.locked {
  pointer-events: none;
  filter: blur(3px);
}

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

button {
  cursor: pointer;
}

.desktop-app {
  display: grid;
  grid-template-columns: 78px minmax(560px, 1fr) clamp(320px, 26vw, 400px);
  height: 100vh;
  max-width: 100vw;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 18px 10px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.app-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #202622, #3a4a3e);
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(32, 38, 34, 0.18);
}

.nav {
  display: grid;
  gap: 10px;
  width: 100%;
}

.nav-item {
  display: grid;
  min-height: 58px;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 8px 0;
}

.nav-item svg,
button svg,
.search svg,
.notice svg,
.alert-strip svg,
.detail-empty svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ico {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  background: rgba(32, 38, 34, 0.08);
  color: currentColor;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.nav-item span {
  font-size: 12px;
  line-height: 1;
}

.nav-item.active {
  background: var(--ink);
  color: white;
}

.app-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: auto;
}

.command-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 22px;
  line-height: 1.2;
}

h2 {
  font-size: 17px;
  line-height: 1.35;
}

.top-actions,
.panel-toolbar,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sync-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.detail-actions {
  display: grid;
  gap: 8px;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 13px;
  white-space: nowrap;
}

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

.ghost-btn {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.danger-btn {
  border-color: #efb9b4;
  background: var(--red-soft);
  color: var(--red);
}

.icon-btn {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: var(--panel);
}

.full {
  width: 100%;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(330px, 32vw);
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 0 12px;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

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

.stat {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.stat strong {
  display: block;
  margin-top: 6px;
  font-size: 30px;
  line-height: 1;
}

.stat.success strong {
  color: var(--green);
}

.stat.muted strong {
  color: #59615c;
}

.stat.warning strong {
  color: var(--amber);
}

.alert-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  border: 1px solid #ead7a4;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 14px;
  font-size: 13px;
  font-weight: 800;
}

.view-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel-toolbar {
  justify-content: space-between;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  padding: 4px;
}

.segment {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0 13px;
}

.segment.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(32, 38, 34, 0.08);
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 292px);
}

table {
  width: 100%;
  min-width: 830px;
  border-collapse: collapse;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

td {
  font-size: 14px;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover,
tbody tr.selected {
  background: #f5f8f2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-sold {
  background: #ecefed;
  color: #59615c;
}

.status-error {
  background: var(--red-soft);
  color: var(--red);
}

.status-off {
  background: #f0eee8;
  color: #756b5d;
}

.account-cell strong,
.account-cell span {
  display: block;
}

.account-cell span,
.private-cell,
.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.private-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-cell {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sort-cell {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.manual-chip {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  padding: 0 10px;
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(46px, 1fr));
  gap: 6px;
}

.mini-btn {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 0 8px;
  white-space: nowrap;
}

.mobile-copy-btn {
  display: none;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head.compact {
  padding: 0;
  border-bottom: 0;
}

.bulk-box {
  display: block;
  width: calc(100% - 32px);
  min-height: 250px;
  margin: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 14px;
  resize: vertical;
  line-height: 1.7;
}

.notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 16px 16px;
  border: 1px solid #ead7a4;
  border-radius: 12px;
  background: var(--amber-soft);
  color: var(--amber);
  padding: 12px;
  font-size: 13px;
  font-weight: 700;
}

.import-result {
  display: grid;
  gap: 7px;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
}

.import-result strong {
  color: var(--ink);
}

.record-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.record-item {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 12px;
}

.record-item time {
  color: var(--muted);
  font-size: 12px;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.settings-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 14px;
}

.settings-card label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.settings-card input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 12px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 0 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.check-row input {
  min-height: auto;
  width: 18px;
  height: 18px;
}

.detail-pane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: #fbfcfa;
  padding: 18px;
  overflow-x: hidden;
  overflow-y: auto;
}

.detail-pane * {
  min-width: 0;
}

.detail-empty {
  display: grid;
  min-height: 100%;
  place-items: center;
  align-content: center;
  gap: 12px;
  color: var(--muted);
  text-align: center;
}

.detail-empty svg {
  width: 34px;
  height: 34px;
}

.detail-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--panel-2);
  color: var(--muted);
  font-weight: 900;
}

.detail-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
  min-width: 0;
}

.email-code-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.email-code-panel h2 {
  margin-top: 3px;
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.detail-list div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  padding: 12px;
  min-width: 0;
}

.detail-list dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  max-width: 100%;
}

.copy-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.copy-line span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.dblcopy {
  cursor: copy;
}

.dblcopy:hover {
  color: var(--blue);
}

.inline-copy {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
}

.manual-only {
  color: var(--amber);
  font-weight: 700;
}

.customer-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

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

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

.customer-card {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  padding: 12px;
}

.customer-card-head,
.customer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-card-head strong {
  overflow-wrap: anywhere;
}

.customer-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #f0eee8;
  color: #756b5d;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.customer-active {
  background: var(--green-soft);
  color: var(--green);
}

.customer-meta,
.customer-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

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

.status-editor {
  display: grid;
  gap: 10px;
}

.hidden {
  display: none;
}

.modal {
  width: min(940px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 28px);
  border: 0;
  border-radius: 14px;
  padding: 0;
  box-shadow: 0 28px 70px rgba(32, 38, 34, 0.24);
  overflow: hidden;
}

.modal::backdrop {
  background: rgba(32, 38, 34, 0.42);
}

.modal-box {
  padding: 20px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}

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

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

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
select {
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--ink);
  padding: 0 12px;
}

.modal-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--ink);
  color: white;
  padding: 12px 14px;
  box-shadow: 0 18px 40px rgba(32, 38, 34, 0.22);
  font-size: 14px;
  font-weight: 700;
}

@media (min-width: 761px) {
  table {
    table-layout: fixed;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width: 62px;
  }

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

  th:nth-child(3),
  td:nth-child(3) {
    width: 196px;
  }

  th:nth-child(4),
  td:nth-child(4) {
    width: 96px;
  }

  th:nth-child(5),
  td:nth-child(5) {
    width: 112px;
  }

  th:nth-child(6),
  td:nth-child(6) {
    width: 78px;
  }

  th:nth-child(7),
  td:nth-child(7) {
    width: 96px;
  }

  th:nth-child(8),
  td:nth-child(8) {
    width: 110px;
  }

  .item-name-cell,
  .account-cell,
  .listed-cell {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .account-cell,
  .listed-cell {
    white-space: nowrap;
  }
}

@media (max-width: 1180px) {
  .desktop-app {
    grid-template-columns: 72px minmax(0, 1fr) minmax(320px, 30vw);
  }

  .detail-pane {
    display: flex;
  }

  .search {
    width: min(280px, 30vw);
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
    background: #f4f6f2;
  }

  .desktop-app {
    display: flex;
    min-height: 100vh;
    height: auto;
    flex-direction: column;
    padding-bottom: calc(74px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  .rail {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 12;
    flex-direction: row;
    gap: 8px;
    border-top: 1px solid var(--line);
    border-right: 0;
    border-bottom: 0;
    background: rgba(251, 252, 250, 0.96);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -10px 28px rgba(32, 38, 34, 0.12);
    backdrop-filter: blur(10px);
  }

  .app-icon {
    display: none;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }

  .nav-item {
    width: auto;
    min-height: 48px;
    border-radius: 10px;
    padding: 6px 0;
  }

  .app-main {
    gap: 12px;
    padding: 12px 12px 0;
    overflow: visible;
  }

  .command-bar {
    position: static;
    display: grid;
    min-height: auto;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
  }

  .top-actions,
  .section-head {
    display: grid;
  }

  .top-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .primary-btn,
  .ghost-btn,
  .danger-btn {
    min-height: 42px;
    border-radius: 9px;
  }

  .search {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 42px;
  }

  .top-actions > .ghost-btn,
  .top-actions > .primary-btn {
    width: 100%;
  }

  .sync-pill {
    grid-column: 1 / -1;
    justify-content: center;
    min-height: 34px;
    border-radius: 10px;
  }

  .stats-grid {
    display: flex;
    gap: 10px;
    margin: 0 -12px;
    overflow-x: auto;
    padding: 0 12px 3px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .stat {
    flex: 0 0 126px;
    scroll-snap-align: start;
    border-radius: 12px;
    padding: 12px;
  }

  .stat strong {
    font-size: 25px;
  }

  .alert-strip {
    align-items: flex-start;
    min-height: 0;
    padding: 11px 12px;
    line-height: 1.45;
  }

  .view-panel {
    border-radius: 12px;
  }

  .panel-toolbar {
    display: grid;
    gap: 10px;
    align-items: stretch;
  }

  .hint {
    display: none;
  }

  .segmented {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .segment {
    flex: 0 0 auto;
    padding: 0 12px;
  }

  .table-wrap {
    overflow: visible;
    max-height: none;
  }

  table {
    min-width: 0;
  }

  table,
  tbody,
  tr {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 8px;
    padding: 8px;
  }

  tbody tr {
    display: grid;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    padding: 10px;
  }

  tbody tr:hover,
  tbody tr.selected {
    border-color: #bcd7c7;
    background: #f8fbf7;
  }

  td {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 6px;
    align-items: start;
    border-bottom: 0;
    padding: 0;
    font-size: 12.5px;
    line-height: 1.3;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
  }

  .item-name-cell {
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.3;
  }

  .account-cell,
  .private-cell,
  .listed-cell {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-all;
    white-space: normal;
  }

  .actions-cell {
    display: block;
    padding-top: 4px;
  }

  .actions-cell::before {
    display: none;
  }

  .row-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .mobile-copy-btn {
    display: inline-flex;
  }

  .mini-btn {
    width: 100%;
    min-height: 32px;
    padding: 0 3px;
    font-size: 12px;
  }

  .detail-pane {
    display: block;
    border-left: 0;
    background: transparent;
    padding: 12px;
    overflow: visible;
  }

  .detail-empty {
    min-height: 120px;
  }

  .detail-head,
  .email-code-panel,
  .customer-panel,
  .detail-list div {
    border-radius: 12px;
  }

  .detail-head {
    align-items: center;
  }

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

  .section-head {
    gap: 12px;
    padding: 14px;
  }

  .section-head > button {
    width: 100%;
  }

  .bulk-box {
    width: calc(100% - 24px);
    min-height: 220px;
    margin: 12px;
  }

  .notice,
  .import-result {
    margin: 0 12px 12px;
  }

  .record-list,
  .rules-grid {
    padding: 12px;
  }

  .rules-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .settings-card {
    grid-template-columns: 1fr;
    margin: 0 12px 12px;
  }

  .settings-card .ghost-btn {
    width: 100%;
  }

  .modal {
    width: 100vw;
    max-width: 100vw;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-radius: 14px 14px 0 0;
  }

  .modal-box {
    max-height: calc(100dvh - 12px);
    padding: 16px;
  }

  .modal-head {
    margin-bottom: 14px;
  }

  input,
  select {
    min-height: 44px;
  }

  .modal-actions {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .modal-actions button {
    width: 100%;
  }

  .toast {
    right: 12px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
  }
}
