.ruler-atlas {
  --paper: #f5f1e8;
  --surface: #fffdf6;
  --forest: #20423a;
  --dark: #152f2b;
  --ink: #292924;
  --muted: #585e53;
  --line: #d9d0bf;
  --gold: #6b4923;
  --wine: #743851;
  --serif: 'Cormorant Garamond', Georgia, serif;
}
.ruler-atlas *, .ruler-atlas *::before, .ruler-atlas *::after { box-sizing: border-box; }
.ruler-atlas { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.58 Inter, system-ui, sans-serif; }
.ruler-atlas h1, .ruler-atlas h2, .ruler-atlas h3, .ruler-atlas p { margin: 0; }
.ruler-atlas button, .ruler-atlas input { font: inherit; }
.ruler-atlas button { cursor: pointer; }
.ruler-atlas a { color: var(--forest); text-underline-offset: .18em; }
.ruler-atlas [hidden] { display: none !important; }
.ruler-atlas :focus-visible { outline: 3px solid #8d452d; outline-offset: 4px; }
.ruler-atlas .wrap { width: min(1300px, calc(100% - clamp(30px, 7.2vw, 112px))); margin-inline: auto; }


.ruler-atlas .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ruler-atlas .hero { isolation: isolate; position: relative; overflow: hidden; border-bottom: 4px solid #b18c55; background: var(--dark); color: #fff9ec; }
.ruler-atlas .hero-art { position: absolute; z-index: -1; inset: 0 0 0 50%; margin: 0; }
.ruler-atlas .hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 42%; }
.ruler-atlas .hero-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#152f2b,#152f2bd1 26%,#152f2b26 76%), linear-gradient(0deg,#182d25ad,transparent 45%); }
.ruler-atlas .hero-art figcaption { position: absolute; bottom: .6rem; right: .85rem; z-index: 1; background: var(--dark); padding: .15rem .42rem; border-radius: 4px; font-size: .75rem; }
.ruler-atlas .hero-art a { color: #fff8eb; }
.ruler-atlas .hero-art a:focus-visible { outline-color: #f3cc89; }
.ruler-atlas .hero-copy { position: relative; pointer-events: none; padding-block: 1.9rem 2.8rem; }


.ruler-atlas .hero h1 { font: 700 clamp(3.5rem, 7.6vw, 6.25rem)/.97 var(--serif); letter-spacing: -.043em; margin: .6rem 0 .35rem; }
.ruler-atlas .hero-copy > p:last-child { color: #f0e8d8; font-size: 1.05rem; max-width: 33rem; }
.ruler-atlas .ruler-workspace { padding-block: 1.6rem 3rem; }
.ruler-atlas .year-console { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 12px 30px #2131260c; }
.ruler-atlas .year-form { display: grid; grid-template-columns: 16rem minmax(0,1fr); align-items: center; gap: 1.2rem 2.25rem; padding: 1.05rem clamp(1rem,3vw,1.8rem); }
.ruler-atlas .year-form label { display: block; color: var(--forest); font-size: .92rem; font-weight: 680; margin-bottom: .3rem; }
.ruler-atlas .stepper { display: flex; align-items: stretch; gap: .3rem; }
.ruler-atlas .stepper button { width: 44px; min-width: 42px; min-height: 42px; padding: .18rem; background: #edf1e8; border: 1px solid #a4b5a9; border-radius: 5px; color: var(--forest); font-weight: 700; font-size: 1.2rem; }
.ruler-atlas .stepper button:hover:not(:disabled) { background: #e1ebe1; }
.ruler-atlas .stepper button:disabled { opacity: .55; cursor: default; }
.ruler-atlas .stepper input { width: 7rem; min-width: 0; text-align: center; font-weight: 670; font-size: 1.55rem; background: var(--surface); border: 1px solid #a4b5a9; border-radius: 5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ruler-atlas .stepper input::-webkit-inner-spin-button, .ruler-atlas .stepper input::-webkit-outer-spin-button { appearance: none; }
.ruler-atlas .stepper input[type="number"] { appearance: textfield; }
.ruler-atlas .range-caption { display: block; font-size: .875rem; color: var(--muted); margin-top: .25rem; }
.ruler-atlas .year-range { min-width: 0; }
.ruler-atlas .year-range input { accent-color: var(--forest); width: 100%; height: 1.8rem; margin: 0; cursor: pointer; }
.ruler-atlas .ticks { display: flex; justify-content: space-between; color: var(--muted); font-size: .875rem; font-variant-numeric: tabular-nums; }
.ruler-atlas .presets { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; border-top: 1px solid var(--line); padding: .7rem clamp(1rem,3vw,1.8rem); }
.ruler-atlas .presets > span { color: var(--muted); font-size: .875rem; font-weight: 650; margin-right: .25rem; }
.ruler-atlas .presets button { min-height: 35px; padding: .25rem .55rem; border: 1px solid #ccbda7; border-radius: 5px; background: var(--surface); color: var(--ink); font-size: .875rem; font-weight: 600; }
.ruler-atlas .presets button:hover { background: #f4ead8; }
.ruler-atlas .presets button[aria-pressed="true"] { background: var(--forest); border-color: var(--forest); color: #fff9ee; }
.ruler-atlas .results-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem 1.4rem; margin: 1.5rem 0 .85rem; }
.ruler-atlas .results-head h2 { color: var(--forest); font: 700 clamp(2.15rem,4.2vw,3.2rem)/1.05 var(--serif); }
.ruler-atlas .results-head p { color: var(--muted); font-size: .93rem; }
.ruler-atlas .year-context { background: #eee6d6; border-left: 3px solid #b38856; border-radius: 4px; padding: .45rem .7rem; max-width: min(100%,27rem); }
.ruler-atlas .year-context strong { display: block; color: var(--gold); font-size: .875rem; }
.ruler-atlas .year-context a { color: inherit; }
.ruler-atlas .year-context p { margin-top: .12rem; color: #4b463a; font-size: .875rem; }
.ruler-atlas .realm-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .8rem; align-items: start; }
.ruler-atlas .realm { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: 0 9px 27px #263c3210; }
.ruler-atlas .realm-head { background: #e9efe6; border-bottom: 1px solid #ccd9ce; padding: .58rem .8rem .67rem; border-radius: 6px 6px 0 0; }
.ruler-atlas .realm-area { color: #47574e; font-size: .875rem; font-weight: 580; }
.ruler-atlas .realm h3 { font: 700 clamp(1.6rem, 2.75vw, 2.05rem)/1.08 var(--serif); color: var(--forest); }
.ruler-atlas .transition { color: var(--wine); font-size: .875rem; font-weight: 630; margin-top: .25rem; }
.ruler-atlas .reigns { list-style: none; margin: 0; padding: .15rem .8rem; }
.ruler-atlas .reign { padding-block: .55rem; }
.ruler-atlas .reign + .reign { border-top: 1px solid var(--line); }
.ruler-atlas .ruler-name { display: block; font: 700 clamp(1.39rem,2.15vw,1.73rem)/1.08 var(--serif); overflow-wrap: anywhere; }
.ruler-atlas .ruler-name a { color: var(--forest); }
.ruler-atlas .ruler-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .18rem .48rem; margin-top: .18rem; color: var(--muted); font-size: .875rem; }
.ruler-atlas .ruler-note { color: #44483e; margin-top: .3rem; font-size: .875rem; }
.ruler-atlas .role { display: inline-block; background: #f0e5cf; color: #634321; border-radius: 4px; font-size: .875rem; font-weight: 650; padding: .1rem .34rem; margin-bottom: .17rem; }
.ruler-atlas .role.claim { color: #653049; background: #f2e3ec; }
.ruler-atlas .role.joint, .ruler-atlas .role.regency { color: #28483b; background: #e6efe5; }
.ruler-atlas .sources { border-top: 1px solid var(--line); padding: .42rem .8rem .53rem; color: var(--muted); }
.ruler-atlas .sources summary { color: var(--forest); font-size: .875rem; font-weight: 630; cursor: pointer; }
.ruler-atlas .sources ul { padding-left: 1.1rem; margin: .2rem 0 0; font-size: .875rem; }
.ruler-atlas .sources li { margin-top: .28rem; }
.ruler-atlas .method { border-top: 1px solid var(--line); color: var(--muted); margin-top: 1.4rem; padding-top: .65rem; font-size: .9rem; }
@media (max-width: 1100px) {
  .ruler-atlas .realm-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 805px) {
  .ruler-atlas .year-form { grid-template-columns: 13rem minmax(0,1fr); gap: .85rem 1.1rem; }
  .ruler-atlas .realm-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 570px) {
  .ruler-atlas .hero-art { inset-inline-start: 29%; }
  .ruler-atlas .hero-art::after { background: linear-gradient(90deg,#152f2b,#152f2bdd 62%,#152f2b99); }
  .ruler-atlas .hero-art figcaption { max-width: calc(100% - 1.2rem); }
  .ruler-atlas .hero-copy { padding-block: 1.4rem 3.2rem; }
  .ruler-atlas .year-form { grid-template-columns: minmax(0,1fr); }
  .ruler-atlas .presets > span { flex-basis: 100%; }
  .ruler-atlas .realm-grid { grid-template-columns: minmax(0,1fr); }
}

.ruler-atlas .hero { padding: 0; }
.ruler-atlas .hero h1 { max-width: none; }
.ruler-atlas .ruler-breadcrumb a { color: #fae2bc; font-size: .94rem; font-weight: 650; pointer-events: auto; }

.ruler-view-tabs{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:24px}.ruler-view-tabs button{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:15px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--forest)}.ruler-view-tabs button[aria-pressed=true]{border:2px solid var(--forest);background:#e9efe6;padding:14px}.ruler-view-tabs span{font-size:.88rem;color:var(--muted)}.reference-intro{margin-bottom:18px}.reference-intro h2,.ruler-reference h2{font:700 clamp(2rem,4vw,3rem)/1.1 var(--serif,Georgia);color:#20423a;margin:0 0 10px}.reference-filters{margin:16px 0}.reference-filters label{display:flex;flex-direction:column;gap:6px;font-weight:600}.reference-filters select{font:inherit;padding:10px;max-width:430px;border:1px solid #a4b5a9;border-radius:5px;background:white;color:#203e35}.reference-jumps{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:22px}.reference-jumps a{padding:6px 11px;background:#e9efe6;border-radius:4px;font-size:.86rem}.ruler-reference{border:1px solid #d9d0bf;background:#fffdf8;border-radius:6px;padding:clamp(12px,3vw,24px);margin:20px 0}.reference-head{margin-bottom:14px}.reference-head p{margin:6px 0}.reference-region,.reference-note{font-size:.86rem;color:#585e53}.reference-table-wrap{overflow:auto;max-width:100%;margin:14px 0;border:1px solid #d9d0bf}.reference-table{border-collapse:collapse;width:100%;min-width:660px;font-size:.9rem;line-height:1.5}.reference-table th,.reference-table td{padding:10px 12px;text-align:left;vertical-align:top;border-bottom:1px solid #e6dfd2}.reference-table thead th{background:#203e35;color:white}.reference-table tbody th{min-width:145px}.reference-table td:nth-child(2){white-space:nowrap}.reference-table tbody tr:nth-child(even){background:#f6f2e9}.reference-table caption{text-align:left;padding:10px;color:#585e53;font-size:.84rem}.ruler-reference h3{font:700 24px Georgia,serif;color:#203e35;margin:20px 0 6px}.ruler-reference li{margin:5px 0}.ruler-reference-page .ruler-reference{padding:0;border:0}.ruler-reference-page .reference-table-wrap:focus-visible{outline:3px solid #c49b57}.ruler-reference-page .reference-head{margin-top:25px}@media(max-width:600px){.ruler-view-tabs{grid-template-columns:1fr}.ruler-reference{padding:12px}}

.ruler-reference [hidden],.ruler-reference-page [hidden]{display:none!important}.reference-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;gap:12px;align-items:end;margin:20px 0;padding:16px;background:#f5f1e8;border:1px solid #d9d0bf;border-radius:6px}.reference-controls label{display:flex;flex-direction:column;gap:4px;font-size:.84rem;color:#203e35;font-weight:600}.reference-controls input,.reference-controls select,.reference-controls button,.realm-chronology-link button{font:inherit;min-width:0;padding:8px 10px;background:#fffdf6;color:#203e35;border:1px solid #b8c2b6;border-radius:4px}.reference-controls button,.realm-chronology-link button{cursor:pointer}.reference-match{font-size:.85rem;color:#585e53;margin:12px 0!important}.reign-timeline-scroll{max-height:520px;overflow:auto;border:1px solid #d9d0bf;background:#faf7ef;padding:12px;margin:12px 0 20px}.reign-timeline-inner{min-width:580px}.reign-axis{margin-left:190px;display:flex;justify-content:space-between;font-size:.75rem;color:#585e53;position:sticky;top:0;background:#faf7ef;z-index:2;padding:5px 0}.reign-track{display:grid;grid-template-columns:180px 1fr;gap:10px;align-items:center;min-height:30px;font-size:.8rem}.reign-barspace{position:relative;height:19px;background:repeating-linear-gradient(to right,#e8e3d8 0,#e8e3d8 1px,transparent 1px,transparent 25%)}.reign-bar{position:absolute;height:17px;border:0;border-radius:3px;background:#648572;padding:0;min-width:5px;cursor:pointer}.reign-bar.claim,.reign-bar.interregnum{background:#a97882}.reign-bar.joint,.reign-bar.regency{background:#b59a65}.reign-bar.aftermath{background:#92958b}.reign-legend{display:flex;flex-wrap:wrap;gap:12px;font-size:.8rem;color:#527461;margin:8px 0}.reign-legend .claim{color:#854e5a}.reign-legend .joint{color:#83672d}.reign-legend .aftermath{color:#62665b}.reference-table .reign-highlight{background:#e1ecdf!important;outline:2px solid #527461;outline-offset:-2px}.realm-chronology-link{padding:8px}.realm-chronology-link button{font-size:.8rem}@media(max-width:800px){.reference-controls{grid-template-columns:1fr 1fr}}@media(max-width:450px){.reference-controls{grid-template-columns:1fr}}

@media(max-width:570px){.ruler-atlas .ticks span:nth-child(even){display:none}.ruler-atlas .ticks{font-size:.75rem}}
