.terms-content { overflow-wrap: anywhere; }
.terms-content-plain { white-space: pre-wrap; }
.terms-content-markdown { white-space: normal; color: #36506e; line-height: 1.55; }
.terms-content-markdown :is(h2, h3, strong) { color: var(--navy); }
.terms-content-markdown h2 {
    margin: 23px 0 0;
    padding-top: 23px;
    border-top: 1px solid #d6dfeb;
    font: 400 clamp(1.625rem, 3vw, 2.125rem)/1.12 Georgia, serif;
    letter-spacing: -.025em;
    scroll-margin-top: 16px;
}
.terms-content-markdown h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.terms-content-markdown h2:target { border-inline-start: 3px solid var(--gold); padding-inline-start: 11px; }
.terms-content-markdown h3 { margin: 13px 0 0; font-size: 1.1875rem; }
.terms-content-markdown :is(p, ul, ol) { margin: 10px 0 0; }
.terms-content-markdown :first-child { margin-top: 0; }
.terms-content-markdown :is(ul, ol) { padding-inline-start: 22px; }
.terms-content-markdown li + li { margin-top: 5px; }
.terms-content-markdown a { color: var(--navy); text-underline-offset: 4px; }

.terms-admin-heading { margin-block: 19px; }
.terms-admin-heading p { margin: 6px 0 0; color: #36506e; }
.terms-admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, .36fr); align-items: start; gap: 16px; }
.terms-panel { min-width: 0; padding: clamp(14px, 2vw, 25px); border: 1px solid #d6dfeb; border-radius: 9px; background: var(--white); }
.terms-status { border-top: 3px solid var(--gold); }
.terms-status h2 { margin: 0; font-size: 1.125rem; line-height: 1.2; }
.terms-status p { margin: 9px 0 0; color: #36506e; font-size: .9375rem; }
.terms-status strong { color: var(--navy); }
.terms-label { display: inline-block; padding: 3px 8px; border-radius: 4px; background: #f3e9c8; color: #5d4209; font-size: .8125rem; font-weight: 650; }
.terms-editor-label, .terms-editor-info, .terms-editor-actions { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 12px; }
.terms-editor-label label { font-weight: 650; }
.terms-editor-label span, .terms-editor-info { color: #36506e; font-size: .8125rem; }
.terms-toolbar:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; padding: 7px; border: 1px solid #8a9bb0; border-bottom: 0; border-radius: 7px 7px 0 0; background: #f0f4f9; }
.terms-toolbar button { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 5px 8px; border: 1px solid #9cacc0; border-radius: 5px; background: var(--white); color: var(--navy); font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; }
.terms-toolbar button:hover { background: #f6edd3; }
.terms-toolbar .operation-icon { width: 16px; height: 16px; flex-basis: 16px; }
.terms-editor textarea { display: block; width: 100%; min-height: 290px; resize: vertical; padding: 13px; border: 1px solid #8a9bb0; border-radius: 7px; background: var(--white); color: var(--navy); font: .875rem/1.65 Consolas, monospace; }
.terms-toolbar:not([hidden]) + textarea { border-start-start-radius: 0; border-start-end-radius: 0; }
.terms-editor-info { margin-top: 7px; }
.terms-editor-info p { margin: 0; }
.terms-editor-actions { justify-content: flex-start; gap: 8px 16px; margin-top: 17px; }
.terms-editor-actions a { display: inline-flex; align-items: center; min-height: 44px; color: var(--navy); text-underline-offset: 4px; }
.terms-editor :is(button, textarea, a):focus-visible, .terms-publish button:focus-visible { outline: 2px solid #765409; outline-offset: 3px; }
.terms-publish { position: sticky; top: 16px; }
.terms-publish-actions { display: grid; gap: 8px; margin-top: 16px; }
.terms-publish-actions button { justify-content: center; }
.terms-preview > header { margin-bottom: 20px; padding-bottom: 19px; border-bottom: 1px solid #d6dfeb; }
.terms-preview > header h2 { margin: 9px 0 0; font: 400 clamp(1.75rem, 3.6vw, 2.75rem)/1.06 Georgia, serif; letter-spacing: -.035em; }

.terms-public { background: var(--white); line-height: 1.55; }
.terms-wrap { width: min(1120px, calc(100% - clamp(32px, 9vw, 100px))); margin-inline: auto; }
.terms-hero { padding-block: clamp(30px, 4.5vw, 62px); border-bottom: 1px solid #d6dfeb; background: #f8f6ef; }
.terms-hero h1 { margin: 0; font: 400 clamp(2.375rem, 5vw, 4.125rem)/1.04 Georgia, serif; letter-spacing: -.038em; }
.terms-hero p { max-width: 55ch; margin: 12px 0 0; color: #36506e; font-size: clamp(1.0625rem, 1.7vw, 1.25rem); }
.terms-hero .terms-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 11px; max-width: none; font-size: .875rem; }
.terms-reading { display: grid; grid-template-columns: minmax(0, 69ch); align-items: start; gap: clamp(24px, 5vw, 72px); padding-block: clamp(24px, 4vw, 54px); }
.terms-reading.terms-with-index { grid-template-columns: minmax(210px, 248px) minmax(0, 69ch); }
.terms-index { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.terms-index-desktop { padding: 2px 6px 2px 15px; border-inline-start: 3px solid var(--gold); }
.terms-index ul { margin: 0; padding: 0; list-style: none; }
.terms-index a { display: flex; align-items: center; min-height: 44px; padding-block: 4px; color: #36506e; font-size: .9375rem; text-decoration: none; }
.terms-index a:hover { text-decoration: underline; text-underline-offset: 4px; }
.terms-index-mobile { display: none; }
.terms-document-end { margin-top: 23px; padding-top: 10px; border-top: 1px solid #d6dfeb; }
.terms-document-end a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--navy); font-weight: 650; text-underline-offset: 4px; }
.terms-document-end .operation-icon { width: 16px; height: 16px; flex-basis: 16px; transform: rotate(-90deg); }
.terms-public :is(a, summary):focus-visible { outline: 2px solid #765409; outline-offset: 3px; }
.terms-index a:focus-visible { outline-offset: -2px; }

@media (max-width: 850px) {
    .terms-reading.terms-with-index { grid-template-columns: minmax(0, 69ch); gap: 24px; }
    .terms-index { position: static; max-height: none; overflow: visible; }
    .terms-index-desktop { display: none; }
    .terms-index-mobile { display: block; border-block: 1px solid #d6dfeb; }
    .terms-index-mobile summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding-inline: 12px; background: #f8f6ef; font-weight: 650; list-style: none; cursor: pointer; }
    .terms-index-mobile summary::-webkit-details-marker { display: none; }
    .terms-index-mobile summary::after { content: ""; width: 7px; height: 7px; margin-inline-end: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
    .terms-index-mobile[open] summary::after { transform: rotate(225deg); }
    .terms-index-mobile ul { padding: 2px 12px 8px; }
}

@media (max-width: 600px) {
    .terms-admin-grid { grid-template-columns: minmax(0, 1fr); }
    .terms-toolbar:not([hidden]) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .terms-toolbar button { min-height: 44px; }
    .terms-editor textarea { font-size: 1rem; }
    .terms-editor-actions .admin-primary { width: 100%; justify-content: center; }
    .terms-publish { position: static; }
    .terms-hero h1 { max-width: 12ch; }
}
