/* Midorry apps — midorry.com/apps/ */
:root {
  --page: #ffffff; --surface: #ffffff; --surface-alt: #f0ede8;
  --text: #2b2b2b; --heading: #181715; --muted: #68635c;
  --line: #e3dfd9; --control: #8a857e;
  --brand: #6aa886; --brand-deep: #4c8a68;
  --link: #35694b; --on-primary: #ffffff; --primary-hover: #2b573e;
  --accent-soft: #edf4ee; --focus: #35694b;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Zen Kaku Gothic New", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #181715; --surface: #24231f; --surface-alt: #2d2b26;
    --text: #f0ede8; --heading: #faf8f3; --muted: #c1bbb2;
    --line: #3a3833; --brand-deep: #91c4a5;
    --link: #91c4a5; --on-primary: #181715; --primary-hover: #abd3b9;
    --accent-soft: #25372c; --focus: #b5dfc4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #181715; --surface: #24231f; --surface-alt: #2d2b26;
  --text: #f0ede8; --heading: #faf8f3; --muted: #c1bbb2;
  --line: #3a3833; --brand-deep: #91c4a5;
  --link: #91c4a5; --on-primary: #181715; --primary-hover: #abd3b9;
  --accent-soft: #25372c; --focus: #b5dfc4; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--text);
  font: 400 18px/30px var(--sans); letter-spacing: 0;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px;
}
h1, h2, h3 { color: var(--heading); font-weight: 500; margin: 0; }
p { margin: 0 0 16px; }
.wrap { max-width: 1184px; margin: 0 auto; padding: 0 32px; }
.skip { position: absolute; top: 8px; inset-inline-start: 16px; background: var(--surface); padding: 8px 12px; z-index: 10; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip:focus { clip-path: none; width: auto; height: auto; }
.eyebrow { font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.eyebrow.green { color: var(--link); }
.muted { color: var(--muted); }
.ext::after { content: " \2197"; font-size: .85em; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); background: var(--page); }
.site-header .wrap { min-height: 88px; display: flex; align-items: center; gap: 24px; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--heading); min-width: 0; }
.brand-mark { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); }
.brand-mark img { width: 36px; height: 32px; object-fit: contain; }
.wordmark { font: 500 30px/34px var(--serif); }
.divider { width: 1px; height: 32px; background: var(--line); }
.section-name { font-size: 18px; color: var(--muted); }
.app-id { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--heading); }
.app-id .badge { width: 36px; height: 36px; }
.app-id .name { font-size: 20px; font-weight: 500; line-height: 24px; display: block; }
.app-id .by { font-size: 12px; line-height: 16px; color: var(--muted); display: block; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { color: var(--text); text-decoration: none; font-size: 16px; font-weight: 500; padding: 10px 12px; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--link); }
.nav a[aria-current="page"] { color: var(--link); border-bottom-color: var(--link); }
.nav .short { display: none; }

/* Theme control */
.theme { position: relative; }
.theme summary { list-style: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; border-radius: 8px; color: var(--text); }
.theme summary::-webkit-details-marker { display: none; }
.theme summary:hover { background: var(--surface-alt); }
.theme svg { width: 22px; height: 22px; }
.theme-menu { position: absolute; right: 0; top: 48px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px; min-width: 150px; z-index: 5; }
.theme-menu button { display: flex; width: 100%; justify-content: space-between; align-items: center; background: none; border: 0; color: var(--text); font: 500 16px/24px var(--sans); padding: 10px 12px; border-radius: 6px; cursor: pointer; min-height: 44px; }
.theme-menu button:hover { background: var(--surface-alt); }
.theme-menu button[aria-checked="true"]::after { content: "\2713"; color: var(--link); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 8px; font: 500 16px/24px var(--sans); text-decoration: none; border: 1px solid var(--control); color: var(--text); background: transparent; }
.btn:hover { background: var(--surface-alt); }
.btn.primary { background: var(--link); border-color: var(--link); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.small { min-height: 44px; padding: 8px 16px; }
.text-link { font-weight: 500; font-size: 16px; display: inline-flex; min-height: 44px; align-items: center; }

/* Bands */
.band { background: var(--surface-alt); }
.hero { padding: 64px 0; }
.hero h1.serif { font: 500 54px/60px var(--serif); max-width: 880px; margin-bottom: 20px; }
.hero .lead { max-width: 760px; font-size: 19px; line-height: 32px; margin: 0; }
section.block { padding: 64px 0; }
section.block > .wrap > h2, .block-head h2 { font-size: 30px; line-height: 40px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.section-intro { margin: 8px 0 32px; color: var(--muted); }

/* App cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; display: flex; flex-direction: column; }
.card-head { display: flex; gap: 20px; align-items: flex-start; }
.badge { width: 64px; height: 64px; border-radius: 10px; background: var(--accent-soft); color: var(--link); display: grid; place-items: center; flex: none; }
.badge svg { width: 55%; height: 55%; }
.card h3 { font-size: 26px; line-height: 34px; }
.card h3 a { color: var(--link); }
.card p { margin: 8px 0 0; color: var(--text); font-size: 17px; line-height: 28px; }
.card .actions { margin-top: auto; padding-top: 24px; padding-left: 84px; gap: 12px 20px; }

/* Contact card */
.contact { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; padding: 32px 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.contact h2 { font-size: 28px; line-height: 36px; margin-bottom: 8px; }
.contact .right { border-left: 1px solid var(--line); padding-left: 32px; }
.contact .mail { font-size: 24px; line-height: 34px; font-weight: 500; display: inline-block; margin-bottom: 4px; }
.contact p { margin: 0; }
.contact.narrow { grid-template-columns: 1fr; gap: 8px; padding: 28px; }
.contact.narrow .right { border: 0; padding: 0; }
.contact.narrow h2 { font-size: 22px; line-height: 30px; margin: 0; }
.contact.narrow .mail { font-size: 18px; line-height: 28px; }

/* Footer */
.site-footer { background: var(--surface-alt); border-top: 1px solid var(--line); margin-top: 64px; }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; font-size: 15px; line-height: 22px; color: var(--muted); }
.site-footer nav { display: flex; gap: 8px 28px; flex-wrap: wrap; }

/* App page */
.app-hero .wrap { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: 48px; align-items: center; }
.app-hero h1 { font-size: 44px; line-height: 52px; margin-bottom: 20px; }
.app-hero .lead { margin-bottom: 28px; }
.app-hero .actions { margin-bottom: 8px; }
.shot-phone { justify-self: center; max-width: 300px; width: 100%; border: 8px solid var(--surface); outline: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.shot-caption { text-align: center; font-size: 14px; line-height: 22px; color: var(--muted); margin-top: 10px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 32px; }
.steps3 > div { padding: 0 28px; border-left: 1px solid var(--line); }
.steps3 > div:first-child { padding-left: 0; border-left: 0; }
.steps3 .num { color: var(--link); font-weight: 500; font-size: 16px; }
.steps3 h3 { font-size: 22px; line-height: 30px; margin: 8px 0; }
.steps3 p { color: var(--muted); font-size: 17px; line-height: 28px; margin: 0; }
.duo { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 10px; padding: 32px; gap: 32px; }
.duo > div { display: flex; gap: 20px; }
.duo > div + div { border-left: 1px solid var(--line); padding-left: 32px; }
.duo .badge { width: 48px; height: 48px; }
.duo h3 { font-size: 22px; line-height: 30px; margin-bottom: 4px; }
.duo p { margin: 0; color: var(--muted); font-size: 17px; line-height: 28px; }
.shots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.shots figure { margin: 0; }
.shots img { border: 1px solid var(--line); border-radius: 10px; aspect-ratio: 600 / 900; object-fit: cover; object-position: top; width: 100%; }
.shots figcaption { font-size: 15px; line-height: 24px; color: var(--muted); margin-top: 10px; }

/* Article rows */
.rows { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.rows li + li { border-top: 1px solid var(--line); }
.rows a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; min-height: 60px; color: var(--text); text-decoration: none; font-size: 17px; line-height: 26px; }
.rows a::after { content: "\2192"; color: var(--link); flex: none; }
.rows a:hover { background: var(--surface-alt); color: var(--link); }
.rows.plain { border: 0; border-radius: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: none; }
.rows.plain a { padding: 14px 4px; color: var(--link); }
.rows.plain a::after { content: "\203A"; font-size: 22px; }
.rows .sub { display: block; font-size: 14px; line-height: 22px; color: var(--muted); }

/* Help home */
.crumbs { font-size: 14px; line-height: 22px; color: var(--muted); margin-bottom: 20px; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--muted); }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.help-hero h1 { font-size: 44px; line-height: 52px; margin-bottom: 8px; }
.search { max-width: 760px; margin-top: 28px; }
.search label { display: block; font-size: 14px; line-height: 22px; font-weight: 500; margin-bottom: 8px; }
.search .row { display: flex; gap: 0; }
.search input { flex: 1; min-width: 0; height: 56px; border: 1px solid var(--control); border-right: 0; border-radius: 8px 0 0 8px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%238a857e' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 16px center; padding: 0 16px 0 48px; font: 400 17px var(--sans); color: var(--text); }
.search button { height: 56px; padding: 0 24px; border-radius: 0 8px 8px 0; border: 1px solid var(--link); background: var(--link); color: var(--on-primary); font: 500 16px var(--sans); cursor: pointer; }
.search button:hover { background: var(--primary-hover); }
.search .hint { font-size: 14px; line-height: 22px; color: var(--muted); margin: 8px 0 0; }
.results { margin-top: 32px; }
.results h2 { font-size: 24px; line-height: 34px; margin-bottom: 16px; }
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 24px; }
.topic { border: 1px solid var(--line); border-radius: 10px; padding: 24px; background: var(--surface); }
.topic-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.topic-head .badge { width: 44px; height: 44px; }
.topic-head h3 { font-size: 22px; line-height: 30px; }
.topic-head .count { margin-left: auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.shots img.bottom { object-position: bottom; }
.topic .rows { border: 0; border-radius: 0; }
.topic .rows a { padding: 12px 0; min-height: 52px; }
.topic .rows a:hover { background: none; }

/* Article */
.article-shell { max-width: 920px; margin: 0 auto; padding: 48px 32px 0; display: grid; grid-template-columns: minmax(0, 680px) 192px; gap: 48px; }
.article h1 { font-size: 38px; line-height: 46px; margin-bottom: 12px; }
.article .updated { font-size: 14px; line-height: 22px; color: var(--muted); margin-bottom: 28px; }
.article h2 { font-size: 24px; line-height: 34px; margin: 40px 0 12px; scroll-margin-top: 24px; }
.article p, .article li { font-size: 18px; line-height: 31px; }
.article ul { padding-left: 24px; margin: 0 0 16px; }
.article li { margin-bottom: 6px; }
.article strong { font-weight: 500; color: var(--heading); }
.ui { font-weight: 500; color: var(--heading); }
.answer { background: var(--accent-soft); border-left: 3px solid var(--brand-deep); border-radius: 8px; padding: 22px 24px; }
.answer .label { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 18px; line-height: 26px; color: var(--heading); margin-bottom: 6px; }
.answer .label svg { width: 22px; height: 22px; color: var(--brand-deep); }
.answer p { margin: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 8px 0 0; }
.steps > li { counter-increment: s; position: relative; padding: 32px 0 0 52px; border-top: 1px solid var(--line); margin-top: 32px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 32px; width: 34px; height: 34px; border-radius: 50%; background: var(--brand-deep); color: var(--on-primary); display: grid; place-items: center; font-weight: 500; font-size: 17px; }
:root[data-theme="dark"] .steps > li::before { color: #181715; }
.steps > li > h2 { margin: 0 0 10px; font-size: 22px; line-height: 32px; }
.figure { margin: 20px 0 8px; }
.figure img { border: 1px solid var(--line); border-radius: 10px; max-width: 300px; width: 100%; }
.figure figcaption { font-size: 14px; line-height: 22px; color: var(--muted); margin-top: 8px; }
.note { background: var(--surface-alt); border-left: 3px solid var(--brand-deep); border-radius: 8px; padding: 20px 22px; margin: 28px 0; }
.note .title { font-weight: 500; color: var(--heading); margin: 0 0 6px; font-size: 18px; }
.note p:last-child { margin: 0; }
.pro { display: inline-block; font-size: 12px; line-height: 18px; font-weight: 500; letter-spacing: .04em; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--link); vertical-align: middle; margin-left: 6px; }
.related { margin-top: 48px; }
.related h2 { margin-bottom: 12px; }
.article .contact { margin-top: 40px; }
.toc { position: sticky; top: 24px; align-self: start; border-left: 1px solid var(--line); padding-left: 16px; font-size: 15px; line-height: 22px; }
.toc .label { font-weight: 500; color: var(--heading); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 8px; color: var(--muted); }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.toc .help { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.toc-mobile { display: none; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 20px; }
.toc-mobile summary { padding: 10px 14px; font-weight: 500; cursor: pointer; min-height: 44px; }
.toc-mobile ol { margin: 0 0 12px; padding-left: 36px; }

@media (max-width: 1023px) {
  .app-hero .wrap { grid-template-columns: 1fr; }
  .article-shell { grid-template-columns: minmax(0, 680px); justify-content: center; }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 767px) {
  body { font-size: 16px; line-height: 27px; }
  .wrap { padding: 0 20px; }
  .site-header .wrap { min-height: 72px; gap: 8px; }
  .wordmark { font-size: 26px; line-height: 30px; }
  .section-name, .divider-hide { display: none; }
  .nav .long { display: none; }
  .nav .short { display: inline-flex; }
  .nav a { padding: 10px 8px; }
  .hero, section.block { padding: 40px 0; }
  .hero h1.serif { font-size: 36px; line-height: 42px; }
  .hero .lead { font-size: 17px; line-height: 28px; }
  .app-hero h1, .help-hero h1 { font-size: 32px; line-height: 40px; }
  section.block > .wrap > h2, .block-head h2 { font-size: 26px; line-height: 34px; }
  .cards, .topics, .duo, .steps3, .shots { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 20px; }
  .card .actions { padding-left: 0; }
  .badge { width: 52px; height: 52px; }
  .card h3 { font-size: 24px; line-height: 32px; }
  .steps3 { gap: 24px; }
  .steps3 > div { padding: 0; border: 0; }
  .duo { padding: 20px; gap: 24px; }
  .duo > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 24px; }
  .contact { grid-template-columns: 1fr; padding: 24px 20px; gap: 16px; }
  .contact .right { border-left: 0; padding-left: 0; }
  .contact h2 { font-size: 22px; line-height: 30px; }
  .contact .mail { font-size: 20px; }
  .article-shell { padding: 28px 20px 0; }
  .article h1 { font-size: 30px; line-height: 37px; }
  .article p, .article li { font-size: 16px; line-height: 27px; }
  .steps > li { padding-left: 0; padding-top: 24px; margin-top: 24px; }
  .steps > li::before { position: static; display: inline-grid; margin-bottom: 8px; }
  .search input { font-size: 16px; }
  .topic { padding: 20px; }
  .actions .btn { flex: 1 1 100%; }
  .card .actions .btn { flex: 0 1 auto; }
}
@media (prefers-reduced-motion: no-preference) {
  a, .btn, .rows a { transition: background-color .12s, color .12s; }
}

/* Language menu */
.lang summary { width: auto; padding: 0 10px; gap: 6px; display: flex; align-items: center; }
.lang-code { font-size: 13px; font-weight: 500; letter-spacing: .04em; }
.lang-menu { min-width: 210px; max-height: 70vh; overflow-y: auto; }
.lang-menu a { display: flex; align-items: center; min-height: 40px; padding: 8px 12px; border-radius: 6px; color: var(--text); text-decoration: none; font-size: 15px; border: 0; }
.lang-menu a:hover { background: var(--surface-alt); }
.lang-menu a[aria-current="true"] { color: var(--link); font-weight: 500; }
.lang-menu a[aria-current="true"]::after { content: "\2713"; margin-inline-start: auto; }

/* Arabic / right to left */
:lang(ar) body, html[lang="ar"] body { font-family: "Noto Sans Arabic", system-ui, sans-serif; }
html[lang="ar"] .hero h1.serif, html[lang="ar"] .wordmark { font-family: "Noto Sans Arabic", system-ui, sans-serif; }
html[lang="ar"] .eyebrow { letter-spacing: 0; }
[dir="rtl"] .theme-menu { right: auto; left: 0; }
[dir="rtl"] .card .actions { padding-left: 0; padding-right: 84px; }
[dir="rtl"] .contact .right { border-left: 0; padding-left: 0; border-right: 1px solid var(--line); padding-right: 32px; }
[dir="rtl"] .steps3 > div { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .steps3 > div:first-child { padding-right: 0; padding-left: 28px; border-right: 0; }
[dir="rtl"] .duo > div + div { border-left: 0; padding-left: 0; border-right: 1px solid var(--line); padding-right: 32px; }
[dir="rtl"] .rows a::after { content: "\2190"; }
[dir="rtl"] .rows.plain a::after { content: "\2039"; }
[dir="rtl"] .answer, [dir="rtl"] .note { border-left: 0; border-right: 3px solid var(--brand-deep); }
[dir="rtl"] .steps > li { padding: 32px 52px 0 0; }
[dir="rtl"] .steps > li::before { left: auto; right: 0; }
[dir="rtl"] .article ul { padding-left: 0; padding-right: 24px; }
[dir="rtl"] .toc { border-left: 0; padding-left: 0; border-right: 1px solid var(--line); padding-right: 16px; }
[dir="rtl"] .toc ol { padding-left: 0; padding-right: 18px; }
[dir="rtl"] .toc-mobile ol { padding-left: 0; padding-right: 36px; }
[dir="rtl"] .search input { border-right: 1px solid var(--control); border-left: 0; border-radius: 0 8px 8px 0; background-position: right 16px center; padding: 0 48px 0 16px; }
[dir="rtl"] .search button { border-radius: 8px 0 0 8px; }
[dir="rtl"] .ext::after { content: " \2196"; }
[dir="rtl"] .crumbs li + li::before { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .ui, [dir="rtl"] bdi { unicode-bidi: isolate; }
@media (max-width: 767px) {
  [dir="rtl"] .card .actions { padding-right: 0; }
  [dir="rtl"] .contact .right { border-right: 0; padding-right: 0; }
  [dir="rtl"] .steps3 > div, [dir="rtl"] .steps3 > div:first-child { padding: 0; border: 0; }
  [dir="rtl"] .duo > div + div { border-right: 0; padding-right: 0; }
  [dir="rtl"] .steps > li { padding: 24px 0 0 0; }
  .lang-code { display: none; }
  .lang summary { width: 44px; padding: 0; justify-content: center; }
}

/* Japanese: break lines at phrase boundaries */
@media (min-width: 768px) { html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3, html[lang="ja"] .lead { word-break: auto-phrase; } }
html[lang="ja"] body { overflow-wrap: anywhere; }

/* Long DNS names and URLs in articles */
.article p, .article li { overflow-wrap: anywhere; }
