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

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1f2937;
  background: #f3f4f6;
}

code {
  font-size: 0.92em;
  background: #e5e7eb;
  padding: 1px 6px;
  border-radius: 4px;
}

.top {
  background: #111827;
  color: #f9fafb;
  padding: 10px 12px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  position: sticky;
  top: 0;
  z-index: 10;
}

.top__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
}

.top__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.top__btn {
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.top__btn:hover,
.top__btn:focus-visible {
  background: #374151;
  color: #fff;
}

.top__btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.top__btn--text {
  color: #fca5a5;
  font-weight: 500;
  padding: 6px 10px;
}

.top__btn--text:hover,
.top__btn--text:focus-visible {
  color: #fff;
  background: #7f1d1d;
}

.brand {
  display: block;
  font-weight: 700;
  font-size: 15px;
  margin: 0;
  color: #f9fafb;
  text-decoration: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.nav--top {
  margin-top: 8px;
}

.nav a {
  color: #d1d5db;
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 4px;
}

.nav a:hover {
  background: #374151;
  color: #fff;
}

.nav a.is-active {
  background: #2563eb;
  color: #fff;
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.has-tabbar .foot {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

.foot {
  max-width: 960px;
  margin: 16px auto 24px;
  padding: 0 12px;
  font-size: 12px;
  color: #6b7280;
}

.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card h1 {
  margin: 0 0 8px;
  font-size: 18px;
}

.card h2 {
  margin: 12px 0 6px;
  font-size: 15px;
}

.hint {
  color: #6b7280;
  font-size: 13px;
}

.warn {
  color: #b45309;
}

.ok {
  color: #15803d;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.tile {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.tile:hover {
  border-color: #2563eb;
}

.tile h2 {
  margin: 0 0 6px;
  font-size: 15px;
  color: #111827;
}

.tile p {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th,
.tbl td {
  border: 1px solid #e5e7eb;
  padding: 6px 8px;
  vertical-align: top;
  word-break: break-all;
}

.tbl th {
  background: #f9fafb;
  text-align: left;
}

.tbl--dense td {
  padding: 4px 6px;
}

.export-tip {
  display: none;
  margin: 12px 0;
  padding: 14px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 10px;
}

.export-tip p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #065f46;
}

.export-tip .btn {
  margin-bottom: 8px;
}

.export-tip--err {
  background: #fef2f2;
  border-color: #fecaca;
}

.export-tip--err p {
  color: #991b1b;
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
  min-height: 0;
  line-height: 1.35;
}

.btn--sm.btn--ghost {
  padding: 5px 10px;
  margin-right: 0;
}

.btn--xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 4px;
  min-height: 24px;
  margin-right: 0;
  box-shadow: none;
}

.select-sm {
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 5px;
  background: #fff;
  margin: 0 4px;
  min-height: 28px;
}

.list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.list-bar__label {
  font-size: 13px;
  color: #4b5563;
  display: inline-flex;
  align-items: center;
}

.list-bar__status {
  font-size: 12px;
  color: #6b7280;
  flex: 1;
  min-width: 8em;
}

.list-bar__meta {
  margin: 0 0 6px;
  font-size: 11px;
  color: #9ca3af;
  line-height: 1.35;
}

.list-bar__pager {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.icc-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0 10px;
  padding: 14px 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  min-height: 56px;
}

.icc-loading__inner {
  width: 100%;
  max-width: 320px;
}

.icc-loading__track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}

.icc-loading__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e, #3b82f6);
  background-size: 200% 100%;
  animation: icc-bar-shine 1.2s linear infinite;
  transition: width 0.15s ease-out;
}

@keyframes icc-bar-shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.icc-loading__text {
  margin: 0;
  font-size: 12px;
  color: #1e40af;
  text-align: center;
}

.icc-progress__pct {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  color: #1d4ed8;
  letter-spacing: 0.02em;
}

.icc-progress-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  background: rgba(15, 23, 42, 0.42);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.icc-progress-modal__card {
  width: 100%;
  max-width: 340px;
  margin: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.icc-progress-modal__title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #1e3a8a;
}

body.icc-export-busy {
  overflow: hidden;
  touch-action: none;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin: 10px 0;
  padding: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.pager--compact {
  padding: 6px 8px;
  gap: 6px 10px;
  margin: 8px 0;
}

.pager__info {
  font-size: 13px;
  color: #374151;
  min-width: 8em;
  text-align: center;
}

.icc-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.icc-select-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 2px;
}

.card--orders .list-bar {
  gap: 6px;
  margin-bottom: 2px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.card--orders .list-bar__label {
  font-size: 12px;
}

.card--orders .list-bar__pager .btn--xs {
  min-width: 26px;
  padding: 2px 5px;
  font-size: 15px;
  line-height: 1;
}

.card--orders .select-sm {
  padding: 2px 6px;
  font-size: 12px;
  min-height: 24px;
  margin: 0 2px;
  border-radius: 4px;
}

.card--orders .icc-list-toolbar {
  gap: 4px;
  margin: 4px 0 6px;
}

.card--orders .warn {
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px !important;
}

.card--orders .card h2 {
  font-size: 14px;
}

.card--orders .card .btn--xs {
  margin: 0 4px 4px 0;
}

.card--orders .tbl--dense {
  font-size: 12px;
}

.card--orders .icc-td-time {
  white-space: nowrap;
  color: #4b5563;
  font-size: 11px;
}

.card--orders .icc-td-cust {
  max-width: 6.5em;
  word-break: break-all;
}

.card--orders .icc-td-ord {
  max-width: 7.5em;
  word-break: break-all;
  font-size: 11px;
}

.icc-date-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 10px;
  text-align: left;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.icc-date-trigger:hover,
.icc-date-trigger:focus-visible {
  border-color: #1d4ed8;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.2);
  outline: none;
}

.icc-date-trigger:active {
  transform: scale(0.99);
}

.icc-date-trigger__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: #2563eb;
  color: #fff;
}

.icc-date-trigger__text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.icc-date-trigger__hint {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: #1d4ed8;
  line-height: 1.2;
  white-space: nowrap;
}

.icc-date-trigger__range {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icc-date-trigger__chev {
  flex-shrink: 0;
  color: #6b7280;
}


.icc-date-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}

.icc-date-modal.is-open {
  display: block;
  pointer-events: auto;
}

.icc-date-modal__mask {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icc-date-modal__sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  max-height: 88vh;
  overflow-y: auto;
  margin: 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border: 1px solid #dbeafe;
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(37, 99, 235, 0.18);
  transform: translateX(-50%);
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 520px) {
  .icc-date-modal__sheet {
    bottom: auto;
    top: 50%;
    border-radius: 12px;
    border-bottom: 1px solid #dbeafe;
    box-shadow: 0 16px 48px rgba(37, 99, 235, 0.2);
    transform: translate(-50%, -50%);
  }
}

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

.icc-date-modal__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}

.icc-date-modal__close {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 2px solid #93c5fd;
  border-radius: 50%;
  background: #fff;
  font-size: 26px;
  line-height: 1;
  color: #2563eb;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.icc-date-modal__close:active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.icc-date-modal__quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 380px) {
  .icc-date-modal__quick {
    grid-template-columns: repeat(2, 1fr);
  }
}

.icc-date-modal__chip {
  margin: 0;
  padding: 11px 8px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #2563eb;
  background: #fff;
  border: 2px solid #3b82f6;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.icc-date-modal__chip:active {
  background: #2563eb;
  color: #fff;
}

.icc-date-modal__chip--muted {
  color: #1e40af;
  background: #f8fbff;
  border-color: #93c5fd;
}

.icc-date-modal__chip--muted:active {
  background: #dbeafe;
  color: #1d4ed8;
}

.icc-date-pick {
  margin: 0 0 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icc-date-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.icc-date-field__label {
  flex-shrink: 0;
  width: 2em;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.icc-date-field__box {
  position: relative;
  flex: 1;
  min-width: 0;
  display: block;
}

.icc-date-field__box::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  z-index: 1;
  width: 15px;
  height: 15px;
  margin-top: -7.5px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none'%3E%3Crect x='3' y='5' width='18' height='16' rx='2' stroke='%232563eb' stroke-width='1.8'/%3E%3Cpath d='M3 9.5h18M8 3v3M16 3v3' stroke='%232563eb' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: 15px 15px;
  pointer-events: none;
}

.icc-date-input {
  display: block;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 0 38px 0 34px;
  box-sizing: border-box;
  font-size: 14px;
  font-weight: 600;
  color: #1e3a8a;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  border: 1px solid #93c5fd;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  color-scheme: light;
}

.icc-date-input:focus {
  outline: none;
  border-color: #2563eb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22);
}

.icc-date-input::-webkit-date-and-time-value {
  text-align: left;
}

.icc-date-input::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 42px;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

.icc-date-modal__actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.icc-date-modal__btn {
  flex: 1;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.icc-date-modal__btn--ghost {
  color: #2563eb;
  background: #fff;
  border: 2px solid #3b82f6;
  touch-action: manipulation;
}

.icc-date-modal__btn--ghost:active {
  background: #eff6ff;
}

.icc-date-modal__btn--primary {
  flex: 1.5;
  color: #fff;
  background: #2563eb;
  border: 2px solid #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  touch-action: manipulation;
}

.icc-date-modal__btn--primary:active {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

body.icc-date-modal-open {
  overflow: hidden;
}


.icc-list-stats {
  margin: 0 0 6px;
  padding: 7px 10px;
  font-size: 12px;
  color: #4b5563;
  line-height: 1.45;
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  word-break: break-all;
}

.icc-list-stats strong {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 0 2px;
}

.icc-list-stats__ok {
  color: #15803d;
}

.icc-list-stats__wait {
  color: #b45309;
}

.icc-batch-pick {
  margin: 8px 0 6px;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.icc-batch-pick__title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.icc-batch-pick__field {
  display: block;
  margin-bottom: 6px;
}

.icc-batch-pick__ta {
  width: 100%;
  min-height: 52px;
  font-size: 13px;
  margin-top: 2px;
}

.icc-batch-pick__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.icc-th-check,
.icc-td-check {
  width: 2.4rem;
  text-align: center;
  vertical-align: middle;
}

.icc-th-check input,
.icc-td-check input {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.muted {
  color: #9ca3af;
  width: 2.5rem;
}

.scroll {
  overflow: auto;
  max-height: 60vh;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

.details {
  margin-top: 10px;
}

.details summary {
  cursor: pointer;
  color: #2563eb;
}

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

.form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.file {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.btn {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
}

.btn:hover {
  background: #1d4ed8;
}

.list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.list li {
  margin-bottom: 6px;
}

.btn--ghost {
  background: #374151;
  color: #f9fafb;
  text-decoration: none;
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  margin-right: 8px;
}

.btn--ghost:hover {
  background: #4b5563;
  color: #fff;
}

.btn--secondary {
  background: #6b7280;
}

.btn--secondary:hover {
  background: #4b5563;
}

.btn--block {
  display: block;
  width: 100%;
  text-align: center;
}

.btn--lg {
  padding: 14px 16px;
  font-size: 16px;
  border-radius: 8px;
  min-height: 48px;
}

.btn.btn--xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 4px;
  min-height: 24px;
  margin-right: 0;
}

.btn.btn--sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px;
  min-height: 0;
  line-height: 1.35;
}

.card--orders .btn.btn--xs.btn--ghost {
  background: #fff;
  color: #4b5563;
  border: 1px solid #d1d5db;
  padding: 2px 8px;
}

.card--orders .btn.btn--xs.btn--ghost:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}

.card--orders .btn.btn--xs.btn--outline {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}

.card--orders .btn.btn--xs.btn--outline:hover:not(:disabled) {
  border-color: #2563eb;
  color: #2563eb;
  background: #fff;
}

.card--orders .btn.btn--xs.btn--primary {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 2px 10px;
}

.card--orders .btn.btn--xs.btn--primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.card--orders .btn.btn--xs:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.input--touch {
  padding: 12px 14px;
  font-size: 16px;
  min-height: 48px;
}

.upload-zone {
  position: relative;
  margin: 12px 0;
  padding: 28px 16px;
  border: 2px dashed #93c5fd;
  border-radius: 12px;
  background: #eff6ff;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

.upload-zone.is-ready {
  border-color: #22c55e;
  background: #f0fdf4;
}

.upload-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.upload-zone__icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 8px;
}

.upload-zone__title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  color: #1d4ed8;
}

.upload-zone__hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #6b7280;
}

.upload-zone__name {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
  word-break: break-all;
}

.upload-zone__name.is-ok {
  color: #15803d;
  font-weight: 600;
}

.sticky-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(52px + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
}

.card--flush-bottom {
  padding-bottom: 72px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
}

.tabbar__item {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 2px 6px;
  text-decoration: none;
  color: #6b7280;
  font-size: 11px;
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.tabbar__label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.15;
}

.tabbar__icon {
  font-size: 20px;
  line-height: 1;
}

.tabbar__item.is-active {
  color: #2563eb;
  font-weight: 600;
}

@media (min-width: 768px) {
  .tabbar {
    display: none;
  }

  .main {
    padding-bottom: 12px;
  }

  .has-tabbar .foot {
    padding-bottom: 0;
  }

  .sticky-bar {
    position: static;
    padding: 12px 0 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .card--flush-bottom {
    padding-bottom: 12px;
  }
}

@media (max-width: 767px) {
  .nav--top {
    display: none;
  }

  .top {
    padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
  }
}

.form--stack {
  flex-direction: column;
  align-items: stretch;
}

.form--stack label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.input,
.textarea {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
}

.textarea {
  font-family: ui-monospace, monospace;
  resize: vertical;
}

.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pre-out {
  background: #111827;
  color: #e5e7eb;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  overflow: auto;
  max-height: 50vh;
}

.table-wrap {
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.tpl-headers {
  margin: 8px 0 12px;
}

.tpl-headers__list {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.tpl-result {
  margin-top: 12px;
}

.tpl-result__box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}

.tpl-result__box.is-ok {
  border-color: #86efac;
  background: #f0fdf4;
}

.tpl-result__box.is-warn {
  border-color: #fcd34d;
  background: #fffbeb;
}

.tpl-result__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.tpl-result__icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.is-ok .tpl-result__icon {
  background: #dcfce7;
  color: #15803d;
}

.is-warn .tpl-result__icon {
  background: #fef3c7;
  color: #b45309;
}

.tpl-result__head-text {
  flex: 1;
  min-width: 0;
}

.tpl-result__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
}

.tpl-result__sub {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

.tpl-result__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.tpl-stat {
  text-align: center;
  padding: 8px 4px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.tpl-stat b {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  color: #111827;
}

.tpl-stat span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #6b7280;
  line-height: 1.2;
}

.tpl-stat--ok b { color: #15803d; }
.tpl-stat--warn b { color: #b45309; }
.tpl-stat--bad b { color: #dc2626; }

.tpl-result__alert {
  margin: 0 0 8px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 6px;
}

.tpl-result__hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: #2563eb;
  text-align: center;
}

.tpl-result__hint--warn {
  color: #b45309;
}

.tpl-result__details {
  margin-top: 6px;
  font-size: 12px;
}

.tpl-result__details summary {
  cursor: pointer;
  color: #2563eb;
  padding: 6px 0;
  user-select: none;
}

.tpl-result__detail-body {
  margin: 0 0 8px;
  padding: 8px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: #4b5563;
  word-break: break-all;
}

.tpl-result__list {
  margin: 0 0 8px;
  padding: 8px 8px 8px 22px;
  background: #f9fafb;
  border-radius: 6px;
  font-size: 11px;
  color: #6b7280;
  line-height: 1.45;
}

.sticky-bar--tpl {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sticky-bar--tpl.has-download {
  padding-top: 8px;
}

.card--tpl-done {
  padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
}

.card.card--flush-bottom.card--tpl-done {
  padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
}

a.btn {
  text-decoration: none;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .card--tpl-done {
    padding-bottom: 12px;
  }

  .sticky-bar--tpl.has-download {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .sticky-bar--tpl.has-download #iccTplDlSuccess {
    grid-column: 1 / -1;
  }
}
