:root {
  color-scheme: light;
  --sip-ink: #10243e;
  --sip-muted: #60718a;
  --sip-line: #cad5e2;
  --sip-soft: #f3f7fb;
  --sip-accent: #0b8f79;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #e9eef4;
  color: var(--sip-ink);
  font-family: Tahoma, Arial, sans-serif;
}

.sip-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: #10243e;
}

.sip-toolbar a,
.sip-toolbar button {
  min-width: 140px;
  border: 1px solid #3c5879;
  border-radius: 10px;
  padding: 10px 18px;
  background: #fff;
  color: #10243e;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.sip-toolbar button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.sip-policy-warning {
  display: grid;
  gap: 5px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #d69a32;
  border-radius: 9px;
  background: #fff6df;
  color: #744910;
  font-size: 11px;
  line-height: 1.55;
}

.sip-qr-unavailable {
  display: grid;
  place-items: center;
  border: 1px dashed #d69a32;
  border-radius: 10px;
  background: #fff8e8;
  color: #8a5a16;
  font-size: 11px;
  font-weight: 700;
}

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

.sip-sheet {
  width: min(210mm, calc(100% - 32px));
  min-height: 0;
  margin: 18px auto;
  padding: 8mm 10mm 7mm;
  background: #fff;
  box-shadow: 0 16px 44px rgba(16, 36, 62, .18);
}

.sip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--sip-accent);
}

.sip-company-copy h1 { margin: 0; font-size: 24px; }
.sip-company-copy p { margin: 6px 0 0; color: var(--sip-muted); font-size: 12px; }
.sip-company-contacts { display: flex; flex-wrap: wrap; gap: 3px 10px; line-height: 1.45; }
.sip-company-contacts > span:not(:last-child)::after { content: " •"; margin-inline-start: 8px; color: var(--sip-line); }
.sip-company-contacts b { color: var(--sip-ink); }

.sip-company-mark {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--sip-line);
  border-radius: 16px;
  background: #fff;
}

.sip-company-mark img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.sip-company-mark span { color: var(--sip-accent); font-size: 34px; font-weight: 800; }

.sip-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 9px 0 8px;
  padding: 8px 11px;
  border-radius: 12px;
  background: var(--sip-soft);
}

.sip-title span { color: var(--sip-muted); font-size: 12px; }
.sip-title h2 { margin: 3px 0 0; font-size: 17px; }
.sip-title > strong { color: var(--sip-accent); font-size: 18px; direction: ltr; }

.sip-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sip-card {
  break-inside: avoid;
  border: 1px solid var(--sip-line);
  border-radius: 12px;
  overflow: hidden;
}

.sip-card h3,
.sip-qr-section > h3 {
  margin: 0;
  padding: 9px 12px;
  background: var(--sip-soft);
  color: var(--sip-ink);
  font-size: 14px;
}

.sip-service { grid-column: auto; }

.sip-card dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin: 0;
}

.sip-card dl > div {
  min-height: 38px;
  padding: 6px 9px;
  border-top: 1px solid #e4eaf1;
}

.sip-card dl > div:nth-child(odd) { border-left: 0; }
.sip-card .sip-wide { grid-column: auto; border-left: 0; }
.sip-card dt { margin-bottom: 5px; color: var(--sip-muted); font-size: 11px; }
.sip-card dd { margin: 0; font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }

.sip-qr-section {
  margin-top: 8px;
  border: 1px solid var(--sip-line);
  border-radius: 12px;
  overflow: hidden;
  break-inside: avoid;
}

.sip-qr-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  padding: 10px;
}

.sip-qr-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid #dce4ed;
  border-radius: 10px;
  text-align: center;
}

.sip-qr-card h4 { margin: 0 0 7px; font-size: 13px; }
.sip-qr { display: grid; width: 104px; height: 104px; margin: 0 auto 5px; place-items: center; }
.sip-qr img, .sip-qr canvas { width: 104px !important; height: 104px !important; }
.sip-qr-card p { margin: 4px 0; font-size: 10px; overflow-wrap: anywhere; }

.sip-footer {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--sip-line);
  color: var(--sip-muted);
  font-size: 10px;
}

@media (max-width: 560px) {
  .sip-sheet { width: calc(100% - 16px); padding: 18px; }
  .sip-sections { grid-template-columns: 1fr; }
  .sip-service { grid-column: auto; }
  .sip-qr-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { width: 210mm; background: #fff; }
  .sip-toolbar { display: none !important; }
  .sip-sheet {
    width: 210mm;
    height: 148.5mm;
    min-height: 148.5mm;
    margin: 0;
    padding: 5mm 7mm;
    overflow: hidden;
    border-bottom: 1px dashed #aebaca;
    box-shadow: none;
  }
  .sip-header { gap: 10px; padding-bottom: 4px; border-bottom-width: 2px; }
  .sip-company-copy h1 { font-size: 16px; }
  .sip-company-copy p { margin-top: 3px; font-size: 8px; line-height: 1.35; }
  .sip-company-mark { width: 36px; height: 36px; border-radius: 10px; }
  .sip-company-mark span { font-size: 23px; }
  .sip-title { margin: 4px 0; padding: 4px 7px; border-radius: 7px; }
  .sip-title span { font-size: 8px; }
  .sip-title h2 { margin-top: 1px; font-size: 12px; }
  .sip-title > strong { font-size: 13px; }
  .sip-sections { gap: 5px; }
  .sip-card { border-radius: 7px; }
  .sip-card h3,.sip-qr-section>h3 { padding: 4px 7px; font-size: 9px; }
  .sip-card dl>div { min-height: 23px; padding: 3px 5px; }
  .sip-card dt { margin-bottom: 2px; font-size: 7px; }
  .sip-card dd { font-size: 8px; line-height: 1.2; }
  .sip-qr-section { margin-top: 5px; border-radius: 7px; }
  .sip-qr-grid { gap: 5px; padding: 5px; }
  .sip-qr-card { padding: 4px; border-radius: 6px; }
  .sip-qr-card h4 { margin-bottom: 3px; font-size: 8px; }
  .sip-qr { width: 78px; height: 78px; margin-bottom: 2px; }
  .sip-qr img,.sip-qr canvas { width: 78px!important; height: 78px!important; }
  .sip-qr-card p { margin: 2px 0; font-size: 7px; }
  .sip-footer { margin-top: 5px; padding-top: 4px; font-size: 7px; }
}
