/* ARROZ manual: three-column documentation layout */
body.manual { background: #fff; }
.m-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.m-header__in { display: flex; align-items: center; gap: 24px; padding: 12px clamp(16px, 3vw, 40px); }
.m-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); flex-shrink: 0; }
.m-logo span { display: flex; flex-direction: column; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.m-logo small { font-size: .7rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.m-search-open { flex: 1; max-width: 640px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--muted); font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.m-search-open span { flex: 1; }
.m-search-open kbd { font: inherit; font-size: .72rem; border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: #fff; }
.m-search-open:hover { border-color: var(--navy); }
.m-nav { border-top: 1px solid var(--line); overflow-x: auto; }
.m-nav ul { list-style: none; margin: 0; padding: 0 clamp(8px, 3vw, 32px); display: flex; gap: 4px; white-space: nowrap; }
.m-nav a { display: block; padding: 10px 14px; font-size: .88rem; color: var(--ink); text-decoration: none; border-bottom: 2px solid transparent; }
.m-nav a:hover { color: var(--navy); }
.m-nav a[aria-current="page"] { color: var(--navy); font-weight: 700; border-bottom-color: var(--gold); }

.m-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 240px; gap: 40px; max-width: 1400px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 64px; }
.m-layout--notoc { grid-template-columns: 270px minmax(0, 1fr); }

/* sidebar tree */
.m-side { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; font-size: .9rem; padding-right: 4px; }
.m-side ul { list-style: none; margin: 0; padding: 0; }
.m-side ul ul { margin-left: 10px; padding-left: 8px; border-left: 1px solid var(--line); }
.m-side a { display: block; padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; line-height: 1.5; }
.m-side > div > ul > li > a, .m-side > div > ul > li > details > summary > a { font-weight: 700; }
.m-side a:hover { background: var(--bg-soft); color: var(--navy); }
.m-side a[aria-current="page"] { background: #eef0f8; color: var(--navy); font-weight: 700; box-shadow: inset 3px 0 0 var(--navy); }
.m-side summary { display: flex; align-items: center; list-style: none; cursor: pointer; }
.m-side summary::-webkit-details-marker { display: none; }
.m-side summary a { flex: 1; }
.m-side summary::after { content: ""; width: 7px; height: 7px; margin: 0 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); rotate: -45deg; transition: rotate .2s; }
.m-side details[open] > summary::after { rotate: 45deg; }
.m-side__mobile { display: none; }

/* main */
.m-main { min-width: 0; }
.m-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 12px; padding: 0; font-size: .8rem; color: var(--muted); }
.m-crumbs li + li::before { content: "›"; margin-right: 4px; }
.m-crumbs a { color: var(--navy); text-decoration: none; }
.m-main h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.4; color: var(--navy); margin: 0 0 20px; }
.m-lead { color: var(--muted); }
.m-prose { font-size: 1rem; line-height: 1.9; overflow-wrap: anywhere; }
.m-prose > * + * { margin-top: 1em; }
.m-prose p { margin: 0; }
.m-prose h2 { font-size: 1.45rem; color: var(--navy); margin: 2.2em 0 .7em; padding-bottom: 8px; border-bottom: 1px solid var(--line); line-height: 1.45; }
.m-prose h3 { font-size: 1.15rem; color: var(--navy); margin: 1.8em 0 .5em; line-height: 1.5; }
.m-prose h4 { font-size: 1rem; margin: 1.5em 0 .4em; }
.m-prose ul, .m-prose ol { padding-left: 1.5em; }
.m-prose li + li { margin-top: .35em; }
.m-prose img { border: 1px solid var(--line); border-radius: 6px; }
.m-prose figure { margin: 1.4em 0; }
.m-prose figcaption { font-size: .82rem; color: var(--muted); text-align: center; }
.m-prose .has-text-align-center, .m-prose .aligncenter { text-align: center; }
.m-prose .wp-block-image { text-align: center; }
.m-prose .wp-block-table, .arroz-role-table-wrap { overflow-x: auto; }
.m-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; line-height: 1.65; }
.m-prose th, .m-prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.m-prose thead th { background: var(--bg-soft); font-weight: 700; }
.m-prose blockquote { margin: 1.4em 0; padding: 12px 18px; border-left: 4px solid var(--gold); background: #faf8f4; }
.m-prose code { background: var(--bg-soft); padding: .1em .4em; border-radius: 4px; font-size: .9em; }
.m-prose pre { background: #1d2233; color: #f3f4f8; padding: 16px; border-radius: 8px; overflow-x: auto; }
.m-prose pre code { background: none; padding: 0; color: inherit; }
.m-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.m-prose .wp-block-columns { display: flex; flex-wrap: wrap; gap: 1.5em; }
.m-prose .wp-block-column { flex: 1 1 260px; min-width: 0; }
.m-prose .has-vivid-red-color { color: #cf2e2e; }
.m-prose--faq p strong:first-child { color: var(--navy); }
.arroz-role-table { table-layout: fixed; }
.arroz-role-table th { text-align: center; }
.arroz-role-table th:first-child, .arroz-role-table td:first-child { width: 40%; text-align: left; }
.arroz-role-table td:not(:first-child) { text-align: center; }
@media (max-width: 768px) { .arroz-role-table { min-width: 680px; } }

/* callouts */
.callout { margin: 1.6em 0; border: 1px solid var(--c-line, #cdd3e3); border-left: 4px solid var(--c, var(--navy)); border-radius: 8px; background: var(--c-bg, #f4f6fb); padding: 14px 18px; }
.callout__title { margin: 0 0 6px !important; font-weight: 700; color: var(--c, var(--navy)); display: flex; align-items: center; gap: 8px; }
.callout__title::before { content: attr(data-label); }
.callout::before { content: attr(data-label); display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: var(--c, var(--navy)); border-radius: 999px; padding: 1px 10px; margin-bottom: 6px; }
.callout__title::before { content: none; }
.callout__body { font-size: .95rem; }
.callout__body > * + * { margin-top: .6em; }
.callout__body ul, .callout__body ol { padding-left: 1.4em; margin: .4em 0 0; }
.callout__link { margin: 8px 0 0 !important; font-size: .9rem; }
.callout--note { --c: #2f3a78; --c-bg: #f4f6fb; --c-line: #d6dbec; }
.callout--info { --c: #1f6fb2; --c-bg: #f1f7fd; --c-line: #cfe2f4; }
.callout--tip { --c: #23805a; --c-bg: #f1faf5; --c-line: #cde9db; }
.callout--warning { --c: #a66a00; --c-bg: #fff8ea; --c-line: #f2dfb5; }
.callout--danger { --c: #b3261e; --c-bg: #fdf2f1; --c-line: #f2cdca; }

/* cards & lists */
.m-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 12px; }
.m-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.m-card:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(15, 19, 80, .08); color: var(--ink); }
.m-card__title { font-weight: 700; color: var(--navy); }
.m-card__desc { font-size: .84rem; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.m-group { margin: 0 0 36px; }
.m-group h2 { font-size: 1.2rem; color: var(--navy); margin: 0 0 4px; }
.m-group h2 a { text-decoration: none; }
.m-children { margin-top: 40px; }
.m-children h2 { font-size: 1.1rem; color: var(--navy); }
.m-updated { margin-top: 40px; font-size: .8rem; color: var(--muted); }
.m-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.m-pager a { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--navy); font-weight: 600; font-size: .92rem; }
.m-pager a span { display: block; font-size: .75rem; font-weight: 400; color: var(--muted); }
.m-pager__next { text-align: right; }
.m-pager a:hover { border-color: var(--navy); }
.m-notes { list-style: none; padding: 0; margin: 0; }
.m-notes li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.m-notes time, .m-date { display: block; font-size: .82rem; color: var(--muted); }
.m-notes a { font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.m-notes p { margin: 4px 0 0; color: var(--muted); font-size: .9rem; }

/* home */
.m-home-hero { padding: 28px; border-radius: 14px; background: linear-gradient(120deg, var(--navy), #24307e); color: #fff; margin-bottom: 36px; }
.m-home-hero h1 { color: #fff !important; margin-bottom: 8px !important; }
.m-home-hero p { margin: 0 0 16px; color: rgba(255, 255, 255, .85); }
.m-home-search { width: min(520px, 100%); padding: 12px 16px; border: 0; border-radius: 8px; background: #fff; color: var(--muted); font: inherit; text-align: left; cursor: pointer; }
.m-status-pill { margin: 16px 0 0 !important; }
.m-status-pill a { display: inline-flex; align-items: center; gap: 8px; color: #fff; font-size: .88rem; }
.m-status-pill a::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #3ccf8e; }
.m-status-pill--degraded a::before, .m-status-pill--maintenance a::before { background: #f2b233; }
.m-status-pill--outage a::before { background: #ef5350; }

/* status */
.m-status { display: grid; gap: 4px; padding: 20px 22px; border-radius: 12px; border: 1px solid #cde9db; background: #f1faf5; margin-bottom: 28px; }
.m-status__level { margin: 0; font-size: 1.25rem; font-weight: 800; color: #23805a; display: flex; align-items: center; gap: 10px; }
.m-status__level::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
.m-status__summary, .m-status__updated { margin: 0; }
.m-status__updated { font-size: .82rem; color: var(--muted); }
.m-status--degraded, .m-status--maintenance { border-color: #f2dfb5; background: #fff8ea; }
.m-status--degraded .m-status__level, .m-status--maintenance .m-status__level { color: #a66a00; }
.m-status--outage { border-color: #f2cdca; background: #fdf2f1; }
.m-status--outage .m-status__level { color: #b3261e; }
.m-incidents { list-style: none; padding: 0; }
.m-incident { padding: 14px 0; border-bottom: 1px solid var(--line); }
.m-incident__head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 4px; }
.m-incident__type { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: #fdf2f1; color: #b3261e; }
.m-incident--maintenance .m-incident__type { background: #fff8ea; color: #a66a00; }
.m-incident__done { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: #f1faf5; color: #23805a; }
.m-note { font-size: .88rem; color: var(--muted); }

/* toc */
.m-toc { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow-y: auto; font-size: .85rem; }
.m-toc > p { margin: 0 0 8px; font-weight: 700; color: var(--navy); }
.m-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.m-toc li a { display: block; padding: 5px 0 5px 12px; color: var(--muted); text-decoration: none; line-height: 1.5; margin-left: -1px; border-left: 2px solid transparent; }
.m-toc li.lv3 a { padding-left: 24px; font-size: .8rem; }
.m-toc li a:hover, .m-toc li a.is-current { color: var(--navy); border-left-color: var(--gold); }
.m-toc__top { display: inline-block; margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--navy); }

/* search dialog */
.m-search { width: min(680px, 94vw); max-height: 80vh; margin-top: 10vh; padding: 0; border: 0; border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25); }
.m-search::backdrop { background: rgba(15, 19, 80, .45); }
.m-search__form { display: flex; gap: 8px; padding: 14px; border-bottom: 1px solid var(--line); }
.m-search__form input { flex: 1; font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.m-search__close { font: inherit; font-size: .8rem; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 0 10px; cursor: pointer; }
.m-search__results { list-style: none; margin: 0; padding: 8px; max-height: 60vh; overflow-y: auto; }
.m-search__results a { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.m-search__results a:hover, .m-search__results a:focus { background: var(--bg-soft); outline: none; }
.m-search__results strong { display: block; color: var(--navy); }
.m-search__results small { color: var(--muted); }
.m-search__results mark { background: var(--gold-soft); color: inherit; padding: 0 1px; }
.m-search__results .m-search__empty { padding: 16px; color: var(--muted); }

.m-footer { border-top: 1px solid var(--line); padding: 20px; text-align: center; font-size: .8rem; color: var(--muted); }
.m-footer p { margin: 0; }

@media (max-width: 1180px) {
  .m-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .m-toc { display: none; }
}
@media (max-width: 860px) {
  .m-layout, .m-layout--notoc { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .m-side { position: static; max-height: none; overflow: visible; }
  .m-side__desktop { display: none; }
  .m-side__mobile { display: block; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 12px; }
  .m-side__mobile > summary { font-weight: 700; color: var(--navy); cursor: pointer; }
  .m-search-open kbd { display: none; }
  .m-logo small { display: none; }
}
