:root {
  --primary: #5b50e6;
  --primary-dark: #4a3fd6;
  --primary-soft: #eeedff;
  --primary-line: #d9d5ff;
  --bg: #f3f4f9;
  --card: #ffffff;
  --text: #262a4a;
  --text-2: #5d6283;
  --muted: #9ca1bb;
  --border: #eceef5;
  --row-hover: #f8f8fd;
  --green: #22b386;
  --green-soft: #e3f6ef;
  --orange: #e98320;
  --orange-soft: #fff1e4;
  --red: #ff5d63;
  --red-soft: #ffeced;
  --gray-soft: #f1f2f7;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(82, 86, 160, .08), 0 2px 6px rgba(82, 86, 160, .04);
  --num: "Outfit", "MiSans", "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  --cn: "MiSans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--cn);
}

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

button { font: inherit; cursor: pointer; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 64px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px 0 24px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px);
  color: var(--text);
  box-shadow: 0 1px 0 var(--border);
}

.brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 500; letter-spacing: .5px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #ff7ac1, #8f86ff, #5b50e6, #3db3f3, #ff7ac1);
  -webkit-mask: radial-gradient(circle, transparent 6px, #000 6.5px);
  mask: radial-gradient(circle, transparent 6px, #000 6.5px);
}
.brand-tag {
  margin-left: 6px; padding-left: 14px;
  border-left: 1px solid var(--border);
  font-size: 14px; font-weight: 400; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}

.top-right { display: flex; align-items: center; gap: 20px; font-size: 13px; }
.top-right .sync { color: var(--muted); display: flex; align-items: center; gap: 6px; font-family: var(--cn); }
.top-right .logout { color: var(--text-2); }
.top-right .logout:hover { color: var(--primary); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex: none;
  display: block; box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(91, 80, 230, .25);
}
.avatar svg { display: block; }
.loc-cell { max-width: 260px; }
.loc-main { display: flex; align-items: center; gap: 6px; }
.loc-main .icon-btn { width: 26px; height: 26px; flex: none; }
.loc-main .pill { flex: none; }

.layout { display: flex; padding-top: 64px; min-height: 100vh; }

.sidebar {
  position: fixed; top: 64px; bottom: 0; left: 0;
  width: 236px; padding: 22px 16px;
  background: #fff; box-shadow: 1px 0 0 var(--border);
  display: flex; flex-direction: column;
}

.side-card {
  height: 128px; margin: 0 2px 22px; border-radius: 18px;
  background: linear-gradient(150deg, #f4f3ff 0%, #fbfbff 100%);
  position: relative; overflow: hidden; padding: 16px 18px;
}
.side-card .t1 { font-weight: 500; font-size: 15px; color: var(--text); }
.side-card .t2 { font-size: 12px; color: var(--muted); margin-top: 2px; }
.side-card svg { position: absolute; right: -6px; bottom: -8px; }

.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 16px; margin: 4px 0;
  border-radius: 12px; color: var(--text-2); font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a svg { flex: none; color: var(--muted); transition: color .15s; }
.nav a:hover { background: var(--gray-soft); color: var(--text); }
.nav a:hover svg { color: var(--text-2); }
.nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.nav a.active svg { color: var(--primary); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }

.side-foot { margin-top: auto; padding: 12px 16px; color: var(--muted); font-size: 12px; line-height: 1.7; }

.main {
  flex: 1; margin-left: 236px; padding: 32px 32px 44px;
  background:
    radial-gradient(900px 340px at 85% -80px, rgba(143, 134, 255, .14), transparent 70%),
    linear-gradient(160deg, #fafbfe 0%, var(--bg) 380px);
  min-width: 0;
}

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 26px; }
.page-head h1 { margin: 0 0 8px; font-size: 26px; font-weight: 500; letter-spacing: .5px; }
.page-head p { margin: 0; color: var(--text-2); max-width: 820px; }

.head-actions { display: flex; gap: 16px; }
.big-btn {
  display: flex; align-items: center; gap: 14px;
  min-width: 230px; height: 70px; padding: 0 22px 0 16px;
  border-radius: 18px; background: #fff;
  color: var(--text); font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.big-btn:hover { transform: translateY(-2px); box-shadow: 0 22px 46px rgba(82, 86, 160, .14); }
.big-btn .ico {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: linear-gradient(140deg, #8f86ff, #5b50e6); color: #fff;
  box-shadow: 0 8px 16px rgba(91, 80, 230, .28);
}
.head-actions .big-btn:nth-child(2) .ico { background: linear-gradient(140deg, #7fd3ff, #3db3f3); box-shadow: 0 8px 16px rgba(61, 179, 243, .26); }
.big-btn small { display: block; font-size: 12px; font-weight: 400; color: var(--muted); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 20px;
  background: #fff; border: 0; color: var(--text-2);
  box-shadow: 0 4px 14px rgba(82, 86, 160, .07);
}
.chip:hover { color: var(--primary); }
.chip b { font-weight: 500; color: var(--text); font-family: var(--num); }
.chip.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; box-shadow: none; }
.chip.active b { color: var(--primary); }
.chip-sep { width: 1px; height: 24px; background: var(--border); align-self: center; }
.filter > .chip {
  width: auto; height: 40px; display: inline-flex; padding: 0 14px 0 18px; border: 0;
  border-radius: 20px; background: #fff; color: var(--text-2); white-space: nowrap;
}
.filter > .chip:hover { background: #fff; color: var(--primary); }
.filter > .chip.active, .filter > .chip.active:hover { background: var(--primary-soft); color: var(--primary); }
.filter > .chip svg { margin-left: -2px; color: var(--muted); transition: transform .15s; }
.filter > .chip.active svg { color: var(--primary); }
.filter > .chip:has(+ .menu.open) svg { transform: rotate(180deg); }
.filter .menu { left: 0; right: auto; top: 46px; min-width: 180px; }
.filter .menu a { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.filter .menu a b { font-weight: 400; color: var(--muted); font-family: var(--num); }
.filter .menu a.on { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.filter .menu a.on b { color: var(--primary); }

.search { display: flex; align-items: center; gap: 10px; }
.search input[type=text], .search input[type=date] {
  height: 40px; padding: 0 14px; border: 0; border-radius: 12px;
  background: #fff; color: var(--text); outline: none; font: inherit;
  box-shadow: 0 4px 14px rgba(82, 86, 160, .07);
}
.search input[type=date] { font-family: var(--num); }
.search input[type=text] { width: 260px; }
.search input:focus { box-shadow: 0 0 0 2px var(--primary-line), 0 4px 14px rgba(82, 86, 160, .07); }
.search .go {
  width: 42px; height: 40px; border: 0; border-radius: 12px;
  background: linear-gradient(140deg, #8f86ff, #5b50e6); color: #fff; display: grid; place-items: center;
  box-shadow: 0 8px 16px rgba(91, 80, 230, .26);
}
.search .go:hover { filter: brightness(1.05); }
.search .reset { color: var(--muted); font-size: 13px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; padding: 6px 0; }

table.grid { width: 100%; border-collapse: separate; border-spacing: 0; }
.grid th {
  text-align: left; font-weight: 400; color: var(--muted);
  background: transparent; padding: 14px 14px 12px; white-space: nowrap; font-size: 12.5px;
  border-bottom: 1px solid var(--border);
}
.grid td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.grid th:first-child, .grid td:first-child { padding-left: 22px; }
.grid th:last-child, .grid td:last-child { padding-right: 22px; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: var(--row-hover); }
.grid .strong { color: var(--text); font-weight: 500; }
.grid .num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.grid .sub { color: var(--muted); font-size: 12px; font-family: var(--cn); }

.type-ico {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, #8f86ff, #5b50e6); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 14px rgba(91, 80, 230, .24);
}
.type-ico.orange { background: linear-gradient(140deg, #ffc077, #ff9a3c); box-shadow: 0 6px 14px rgba(255, 154, 60, .24); }
.type-ico.green { background: linear-gradient(140deg, #5ad8ae, #22b386); box-shadow: 0 6px 14px rgba(34, 179, 134, .24); }
.type-ico.gray { background: var(--gray-soft); color: var(--muted); box-shadow: none; }

.pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin: 2px 4px 2px 0;
  border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-size: 12.5px; white-space: nowrap;
}
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: var(--gray-soft); color: var(--muted); }
.pill.mono { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; background: var(--gray-soft); color: var(--text-2); }

.switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; border-radius: 12px; background: #e3e5ef; transition: background .2s; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(38, 42, 74, .18); transition: transform .2s;
}
.switch input:checked + span { background: linear-gradient(140deg, #8f86ff, #5b50e6); }
.switch input:checked + span::after { transform: translateX(20px); }

.more { position: relative; display: inline-block; }
.more > button {
  width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
  display: grid; place-items: center;
}
.more > button:hover { background: var(--primary-soft); color: var(--primary); }
.menu {
  position: absolute; right: 0; top: 36px; z-index: 30; min-width: 150px; padding: 6px;
  background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(38, 42, 74, .16); display: none;
}
.menu.open { display: block; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-radius: 9px;
  background: none; color: var(--text); font-size: 14px;
}
.menu a:hover, .menu button:hover { background: var(--primary-soft); color: var(--primary); }
.menu .danger { color: var(--red); }
.menu .danger:hover { background: var(--red-soft); color: var(--red); }

.qr-thumb {
  width: 48px; height: 48px; border-radius: 10px; padding: 3px; background: #fff;
  box-shadow: 0 4px 12px rgba(82, 86, 160, .12); cursor: zoom-in; display: block;
}

.link-cell { display: flex; align-items: center; gap: 6px; max-width: 280px; }
.link-cell code {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; color: var(--text-2);
}
.icon-btn {
  width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--primary); color: #fff; }

.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.empty svg { margin-bottom: 10px; color: #cdd0e2; }

.link-btn { border: 0; background: none; color: var(--primary); padding: 0; font-family: var(--num); }
.link-btn:hover { text-decoration: underline; }

.mask {
  position: fixed; inset: 0; z-index: 50; background: rgba(38, 42, 74, .34); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.mask.open { display: flex; }
.modal {
  width: 520px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 22px; box-shadow: 0 40px 90px rgba(38, 42, 74, .26);
}
.modal.wide { width: 860px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 26px 8px; }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 500; }
.modal-head .x { border: 0; background: var(--gray-soft); width: 34px; height: 34px; border-radius: 10px; font-size: 20px; color: var(--muted); line-height: 1; }
.modal-body { padding: 12px 26px 8px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 26px 24px; }
.modal img.qr-big { display: block; margin: 0 auto; width: 280px; height: 280px; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--text-2); font-size: 13px; }
.field select, .field input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid #e3e5ef; border-radius: 12px;
  background: #fff; font: inherit; color: var(--text); outline: none;
}
.field select:focus, .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 80, 230, .12); }
.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.btn {
  height: 40px; padding: 0 20px; border-radius: 12px; border: 0;
  background: var(--gray-soft); color: var(--text-2);
}
.btn:hover { background: #e7e8f1; color: var(--text); }
.btn.primary { background: linear-gradient(140deg, #7d73ff, #5b50e6); color: #fff; box-shadow: 0 10px 20px rgba(91, 80, 230, .26); }
.btn.primary:hover { filter: brightness(1.05); color: #fff; }
.btn.danger { background: linear-gradient(140deg, #ff8589, #ff5d63); color: #fff; box-shadow: 0 10px 20px rgba(255, 93, 99, .24); }
.btn.danger-outline { background: var(--red-soft); color: var(--red); }
.btn.danger-outline:hover { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 16px 20px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); border-left: 3px solid var(--red); }
.danger-zone b { display: block; margin-bottom: 2px; color: var(--red); font-weight: 500; }
.danger-zone span { color: var(--text-2); font-size: 13px; }

.hint { color: var(--muted); font-size: 12px; margin-top: 8px; }

#toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px); z-index: 99;
  padding: 11px 22px; border-radius: 14px; background: var(--text); color: #fff; font-size: 14px;
  box-shadow: 0 16px 36px rgba(38, 42, 74, .24);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); }

.lines-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.lines-table th, .lines-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.lines-table th { color: var(--muted); font-weight: 400; }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center;
  background:
    radial-gradient(600px 420px at 85% 10%, rgba(143, 134, 255, .22), transparent 70%),
    radial-gradient(520px 380px at 10% 95%, rgba(61, 179, 243, .14), transparent 70%),
    linear-gradient(160deg, #fafbfe, #eceef7);
}
.login-card { width: 400px; max-width: calc(100% - 40px); padding: 38px 36px 32px; background: #fff; border-radius: 24px; box-shadow: 0 30px 70px rgba(70, 74, 150, .16); }
.login-card::before {
  content: ""; display: block; width: 38px; height: 38px; border-radius: 50%; margin-bottom: 18px;
  background: conic-gradient(from 200deg, #ff7ac1, #8f86ff, #5b50e6, #3db3f3, #ff7ac1);
  -webkit-mask: radial-gradient(circle, transparent 8px, #000 8.5px);
  mask: radial-gradient(circle, transparent 8px, #000 8.5px);
}
.login-card h1 { margin: 0 0 4px; font-size: 22px; font-weight: 500; }
.login-card p { margin: 0 0 26px; color: var(--muted); }
.login-card .btn { width: 100%; height: 46px; margin-top: 8px; font-size: 15px; }
.login-card .error { color: var(--red); margin-bottom: 10px; font-size: 13px; }

@media (max-width: 1100px) {
  .sidebar { width: 76px; padding: 20px 10px; }
  .side-card, .nav a span, .side-foot { display: none; }
  .nav a { justify-content: center; padding: 0; }
  .nav a.active::before { left: -10px; }
  .main { margin-left: 76px; }
  .head-actions { flex-direction: column; }
}

.big-btn { white-space: nowrap; }
.grid td.num, .grid .nowrap { white-space: nowrap; }
.grid td.strong { min-width: 180px; }

.dev-late { color: var(--orange); }
.st-done { color: var(--green); }
.st-void { color: var(--red); }
.dev-early { color: var(--green); }
.field input[type="datetime-local"] { width: 100%; }
.nav a.screen-link { margin-top: 12px; background: linear-gradient(140deg, #f4f3ff, #ffffff); color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-line); }
.nav a.screen-link svg { color: var(--primary); }
.nav a.screen-link:hover { background: linear-gradient(140deg, #7d73ff, #5b50e6); color: #fff; box-shadow: 0 10px 20px rgba(91, 80, 230, .26); }
.nav a.screen-link:hover svg { color: #fff; }

@media (max-width: 760px) {
  .loc-cell { max-width: none; }
  .danger-zone { flex-direction: column; align-items: stretch; padding: 14px; }
  .danger-zone .btn { height: 44px; }
  html, body { overflow-x: hidden; }
  .topbar { height: 56px; padding: 0 14px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand .logo { width: 28px; height: 28px; }
  .brand-tag { margin-left: 8px; padding-left: 10px; font-size: 13px; }
  .top-right { gap: 12px; }
  .top-right .sync, .avatar { display: none; }

  .layout { padding-top: 56px; }
  .sidebar {
    top: auto; bottom: 0; right: 0; width: auto; height: auto; z-index: 20;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; box-shadow: 0 -1px 0 var(--border), 0 -8px 24px rgba(82, 86, 160, .08);
  }
  .side-card, .side-foot { display: none; }
  .nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav a, .nav a.screen-link {
    flex-direction: column; justify-content: center; gap: 2px; height: 52px; margin: 0; padding: 0 2px;
    font-size: 11px; border: 0; box-shadow: none; background: transparent; color: var(--text-2);
  }
  .nav a span { display: block; white-space: nowrap; }
  .nav a.active { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
  .nav a.active::before { display: none; }
  .nav a.screen-link svg { color: var(--muted); }
  .nav a.screen-link:hover, .nav a:hover { background: var(--primary-soft); color: var(--primary); }

  .main { margin-left: 0; padding: 16px 12px calc(84px + env(safe-area-inset-bottom)); }
  .page-head { flex-direction: column; gap: 12px; margin-bottom: 14px; }
  .page-head h1 { font-size: 20px; margin: 0 0 4px; }
  .page-head p { font-size: 13px; }
  .page-head .hint { overflow-wrap: anywhere; }
  .head-actions { flex-direction: column; width: 100%; gap: 10px; }
  .big-btn {
    min-width: 0; height: 56px; padding: 0 14px; gap: 12px; font-size: 15px;
  }
  .big-btn .ico { width: 34px; height: 34px; border-radius: 10px; flex: none; }
  .big-btn .ico svg { width: 18px; height: 18px; }
  .big-btn small { font-size: 11px; }

  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 12px; }
  .chips { gap: 8px; }
  .chip, .filter > .chip { flex: none; height: 38px; }
  .search { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; min-width: 0; width: 100%; }
  .search input[type=date] { width: 100%; min-width: 0; }
  .search input[type=date] + input[type=date] { grid-column: 2 / 4; }
  .search input[type=text] { grid-column: 1 / 3; width: 100%; min-width: 0; }
  .search .go { width: 44px; height: 44px; }
  .search input[type=text], .search input[type=date] { height: 44px; }
  .search .reset { grid-column: 1 / -1; justify-self: end; }

  .card { background: transparent; box-shadow: none; overflow: visible; padding: 0; }
  table.grid, .grid tbody { display: block; }
  .grid thead { display: none; }
  .grid tr {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
    column-gap: 0; margin-bottom: 12px; padding: 12px 14px 10px;
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .grid tbody tr:hover td { background: transparent; }
  .grid td {
    grid-column: 1 / -1; display: flex; align-items: flex-start; gap: 12px; min-width: 0;
    padding: 5px 0; border-bottom: 0; white-space: normal;
  }
  .grid td[data-label]::before {
    content: attr(data-label); flex: none; width: 64px; color: var(--muted); font-size: 13px; line-height: 24px;
  }
  .grid td[data-label] > * { min-width: 0; }
  .grid td[data-label]:has(> .pill) { position: relative; flex-wrap: wrap; gap: 4px 6px; padding-left: 76px; }
  .grid td[data-label]:has(> .pill)::before { position: absolute; left: 0; top: 5px; }
  .grid td[data-label] > .pill { flex: none; margin: 0; }
  .grid td[data-label]:has(> .pill) > .sub { flex-basis: 100%; }
  .grid td.num, .grid .nowrap { white-space: normal; }
  .grid td.strong { min-width: 0; }
  .grid td.m-hide { display: none; }
  .grid td.m-title {
    grid-row: 1; grid-column: 1 / 3; display: block; padding: 2px 0 10px;
    font-size: 16px; font-weight: 600; color: var(--text);
  }
  .grid td.m-lead { grid-row: 1; grid-column: 1; padding: 0 12px 10px 0; align-self: stretch; }
  .grid td.m-lead ~ td.m-title { grid-column: 2; }
  .grid td.m-title .sub { font-weight: 400; margin-top: 2px; }
  .grid td.m-op { grid-row: 1; grid-column: 3; padding: 0 0 10px 8px; align-self: stretch; }
  .grid td.m-op:empty { display: none; }
  .grid tr > td.m-title, .grid tr > td.m-op, .grid tr > td.m-lead { border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
  .more > button { width: 36px; height: 36px; }
  .menu { top: 40px; min-width: 170px; }
  .menu a, .menu button { padding: 12px 14px; font-size: 15px; }
  .link-cell { max-width: 100%; flex: 1; }
  .icon-btn { width: 32px; height: 32px; }
  .qr-thumb { width: 56px; height: 56px; }

  .mask { align-items: flex-end; padding: 0; }
  .modal, .modal.wide { width: 100%; max-height: 88vh; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .modal-head { padding: 18px 18px 6px; }
  .modal-body { padding: 10px 18px 6px; overflow-x: auto; }
  .modal-foot { padding: 14px 18px 18px; }
  .modal-foot .btn { flex: 1; height: 44px; }
  .modal img.qr-big { width: min(280px, 100%); height: auto; }
  .lines-table { min-width: 520px; }
  .field-row { grid-template-columns: 1fr; }
  .field select, .field input { height: 44px; font-size: 16px; }
  .search input[type=text], .search input[type=date] { font-size: 16px; }
  #toast { top: 68px; max-width: calc(100% - 32px); }

  .login-card { padding: 28px 22px 24px; }
  .login-card .field input { font-size: 16px; }
}

.theme-switch { display: flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--gray-soft); }
.theme-switch button { height: 28px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: 13px; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button.on { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 2px 8px rgba(82, 86, 160, .14); }

@media (max-width: 760px) {
  .brand-tag { display: none; }
}

.pill.goods { font-family: var(--num, inherit); font-weight: 500; }
@media (min-width: 761px) {
  .grid th.fit, .grid td.fit { width: 1%; white-space: nowrap; }
  .grid th.sup-col, .grid td.sup-col { width: 20%; min-width: 240px; }
  .grid th.c, .grid td.c { text-align: center; }
  .grid td.c .loc-main { justify-content: center; }
  .grid td.c .link-cell { max-width: 360px; margin: 0 auto; }
  .grid th.loc-col, .grid td.loc-cell { width: 1%; white-space: nowrap; }
  .grid td.c .more .menu { text-align: left; }
  .grid td.c .more > button { margin: 0 auto; }
}
@media (min-width: 761px) and (max-width: 1600px) {
  .grid th.sup-col, .grid td.sup-col { min-width: 200px; }
  .grid td.c .link-cell { max-width: 150px; }
  .grid td.loc-cell { min-width: 130px; white-space: normal; }
  .grid th, .grid td { padding-left: 8px; padding-right: 8px; }
}
