/* Shared styles for DialSheet static website (dialsheet.app).
   Zero framework dependencies; responsive at 375px with accessible accordion,
   table container, dialog modal, and dark-mode color-scheme support. */
:root {
  --bg-light: #F2F5F1;
  --surface-light: #FFFFFF;
  --surface2-light: #E8EDE7;
  --border-light: #D5DED4;
  --text-light: #10261D;
  --muted-light: #445B51;
  --brand-light: #167A4E;
  --brand2-light: #105D3B;
  --brand-soft-light: rgba(22, 122, 78, 0.09);
  --on-brand-light: #FFFFFF;
  --warn-soft-light: #FFF4DC;

  --bg-dark: #0D1411;
  --surface-dark: #141E1A;
  --surface2-dark: #1C2924;
  --border-dark: #293B33;
  --text-dark: #EDF4EF;
  --muted-dark: #9CB4A8;
  --brand-dark: #5CE0A0;
  --brand2-dark: #38C684;
  --brand-soft-dark: rgba(92, 224, 160, 0.13);
  --on-brand-dark: #072617;
  --warn-soft-dark: #2A2210;

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-2: var(--surface2-light);
  --border: var(--border-light);
  --text: var(--text-light);
  --muted: var(--muted-light);
  --brand: var(--brand-light);
  --brand-2: var(--brand2-light);
  --brand-soft: var(--brand-soft-light);
  --on-brand: var(--on-brand-light);
  --warn-soft: var(--warn-soft-light);
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 38, 29, 0.05), 0 6px 20px rgba(16, 38, 29, 0.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans Devanagari', sans-serif;
  color-scheme: light dark;
  accent-color: var(--brand);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--bg-dark);
    --surface: var(--surface-dark);
    --surface-2: var(--surface2-dark);
    --border: var(--border-dark);
    --text: var(--text-dark);
    --muted: var(--muted-dark);
    --brand: var(--brand-dark);
    --brand-2: var(--brand2-dark);
    --brand-soft: var(--brand-soft-dark);
    --on-brand: var(--on-brand-dark);
    --warn-soft: var(--warn-soft-dark);
    --shadow: none;
  }
}

@supports (color: light-dark(white, black)) {
  :root {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-2: light-dark(var(--surface2-light), var(--surface2-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --muted: light-dark(var(--muted-light), var(--muted-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-2: light-dark(var(--brand2-light), var(--brand2-dark));
    --brand-soft: light-dark(var(--brand-soft-light), var(--brand-soft-dark));
    --on-brand: light-dark(var(--on-brand-light), var(--on-brand-dark));
    --warn-soft: light-dark(var(--warn-soft-light), var(--warn-soft-dark));
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 20; border: 1px solid var(--border); }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 10; }
.site-header .inner { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; }
.site-nav { display: flex; gap: 4px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.site-nav a.lang-link { border: 1px solid var(--border); font-size: 0.85rem; }
.site-nav a.btn { color: var(--on-brand); background: var(--brand); margin-left: 4px; }
@media (max-width: 740px) {
  .site-nav a:not(.btn):not(.lang-link) { display: none; }
}

/* Main */
.wrap { max-width: 780px; margin: 0 auto; padding: 28px 16px 64px; }
.wrap.wide { max-width: 1080px; }
.crumbs { font-size: 0.86rem; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); }
h1 { font-size: clamp(1.85rem, 4.4vw, 2.55rem); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 1.42rem; line-height: 1.25; margin: 38px 0 12px; letter-spacing: -0.01em; font-weight: 750; }
h3 { font-size: 1.12rem; margin: 26px 0 8px; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 20px; }
.updated { font-size: 0.85rem; color: var(--muted); margin: 0 0 22px; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 6px; }
hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; }

/* Hero */
.hero { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center; padding: 12px 0 24px; }
.hero-shot { display: flex; justify-content: center; }
.hero-shot img { width: 250px; height: 445px; border-radius: 24px; border: 1px solid var(--border); box-shadow: var(--shadow); background: var(--surface); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.pill { display: inline-block; font-size: 0.82rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0 10px; }
.store-note { font-size: 0.88rem; color: var(--muted); margin: 6px 0 0; }
@media (max-width: 780px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 4px; }
  .hero-shot img { width: 220px; height: 391px; }
}

/* Screenshots rail */
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin: 20px 0; }
.shot-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; text-align: center; box-shadow: var(--shadow); }
.shot-card img { width: 100%; max-width: 210px; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.shot-card figcaption { margin-top: 8px; font-size: 0.88rem; color: var(--muted); font-weight: 600; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.grid .card { text-decoration: none; color: var(--text); display: block; }
.grid a.card:hover { border-color: var(--brand); }
.grid .card h3 { margin: 0 0 6px; }
.grid .card p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* Buttons */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: var(--on-brand); border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.secondary, button.btn.secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn:hover, button.btn:hover { filter: brightness(1.06); }

/* CTA band */
.cta { background: var(--brand-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 36px 0; }
.cta h2 { margin-top: 0; }
.cta p { margin: 0 0 16px; color: var(--muted); }

/* Responsive tables */
.table-wrap { overflow-x: auto; max-inline-size: 100%; margin: 16px 0; border: 1px solid var(--border); border-radius: 12px; container-type: inline-size; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.94rem; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; position: sticky; inset-block-start: 0; z-index: 1; }
tr:last-child td { border-bottom: none; }
.yes { color: var(--brand); font-weight: 700; }
.no { color: var(--muted); }

/* Tools & Calculators */
.calc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 22px 0; }
.calc label { display: block; font-weight: 600; font-size: 0.9rem; margin: 12px 0 4px; }
.calc input[type="text"], .calc input[type="number"], .calc select, .calc textarea {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
}
.calc input[type="file"] { font: inherit; padding: 8px 0; max-width: 100%; }
.calc .row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.calc .result { margin-top: 18px; padding: 16px; border-radius: 12px; background: var(--brand-soft); border: 1px solid var(--border); }
.stats-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin-bottom: 12px; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stat-box strong { display: block; font-size: 1.25rem; }
.stat-box span { font-size: 0.82rem; color: var(--muted); }
.check-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 8px; }
.check-item { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.92rem; margin: 0 !important; }
.check-item input { width: 18px; height: 18px; }
.status-msg { font-size: 0.9rem; font-weight: 600; color: var(--brand); min-height: 1.4em; margin: 8px 0 0; }
.path-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-top: 10px; }

/* FAQ Accordion */
.faq details { border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; margin: 8px 0; background: var(--surface); }
.faq summary {
  font-weight: 700; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: ""; inline-size: 0.85em; block-size: 0.85em; flex-shrink: 0; background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 5.5 8 10l4.5-4.5-1.1-1.1L8 7.8 4.6 4.4z'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 5.5 8 10l4.5-4.5-1.1-1.1L8 7.8 4.6 4.4z'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}
.faq details[open] > summary::before { rotate: 0deg; }
@media (prefers-reduced-motion: no-preference) {
  .faq summary::before { transition: rotate 0.2s; }
  .faq details::details-content {
    interpolate-size: allow-keywords; overflow: clip; contain: layout;
    transition: block-size 0.25s ease, content-visibility 0.25s ease allow-discrete;
  }
  .faq details:not([open])::details-content { block-size: 0; }
}
.faq details p { margin: 10px 0 0; color: var(--muted); }

.note { background: var(--warn-soft); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; font-size: 0.94rem; margin: 16px 0; }

/* Dialog modal for QR */
dialog#qr-dialog {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
  padding: 24px; max-width: 380px; width: calc(100% - 32px); box-shadow: var(--shadow);
}
dialog#qr-dialog::backdrop { background: rgba(10, 20, 15, 0.55); backdrop-filter: blur(2px); }
.qr-wrap { text-align: center; }
.qr-wrap img { width: 200px; height: 200px; background: #FFFFFF; padding: 10px; border-radius: 12px; border: 1px solid var(--border); margin: 12px auto; display: block; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); font-size: 0.9rem; color: var(--muted); }
.site-footer .inner { max-width: 1080px; margin: 0 auto; padding: 32px 16px; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.site-footer h4 { margin: 0 0 8px; color: var(--text); font-size: 0.92rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); text-decoration: underline; }
.site-footer .copy { max-width: 1080px; margin: 0 auto; padding: 0 16px 24px; font-size: 0.85rem; }
