:root {
    --stone-50: #fafaf9;
    --stone-100: #f5f5f4;
    --stone-200: #e7e5e4;
    --stone-400: #a8a29e;
    --stone-600: #57534e;
    --stone-700: #44403c;
    --stone-800: #292524;
    --stone-900: #1c1917;
    --amber-100: #fef3c7;
    --amber-300: #fcd34d;
    --amber-700: #b45309;
    --amber-800: #92400e;
    --amber-900: #78350f;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Noto Sans SC", "Noto Sans JP", "Segoe UI", sans-serif;
    color: var(--stone-900);
    background: var(--stone-50);
    line-height: 1.7;
}

h1, h2, h3 {
    margin: 0 0 0.75rem;
    line-height: 1.3;
    font-family: "Noto Serif SC", "Noto Serif JP", "Songti SC", serif;
}

p {
    margin: 0 0 1rem;
}

a {
    color: inherit;
    text-decoration: none;
}

.cms-editable[data-cms-field="body"],
.cms-editable[data-cms-field="subtitle"] {
    white-space: pre-line;
}

.cms-richtext-editable,
.project-detail-richtext {
    white-space: normal !important;
}

.project-detail-richtext p:last-child {
    margin-bottom: 0;
}

.project-detail-richtext img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.project-detail-richtext ul,
.project-detail-richtext ol {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.project-detail-richtext blockquote {
    margin: 0 0 1rem;
    padding-left: 0.9rem;
    border-left: 3px solid var(--stone-300);
    color: var(--stone-700);
}

.container {
    width: min(1160px, 92%);
    margin: 0 auto;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid var(--stone-200);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 78px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--amber-700), var(--amber-900));
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    display: grid;
    place-items: center;
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
    font-size: 1.05rem;
    overflow: hidden;
}

.brand-mark-fallback {
    transition: opacity 0.2s ease;
}

.brand-mark[style*="background-image"] .brand-mark-fallback {
    opacity: 0;
}

.brand-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.05rem;
    font-weight: 600;
}

.brand-sub {
    font-size: 0.7rem;
    color: var(--stone-600);
    letter-spacing: 0.06em;
}

.desktop-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.nav-link {
    position: relative;
    color: var(--stone-700);
    padding: 0.4rem 0;
    font-size: 0.92rem;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--amber-800);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -4px;
    height: 2px;
    background: var(--amber-800);
}

.language-form {
    margin-left: 0.8rem;
}

.language-form select {
    border: 1px solid var(--stone-300, #d6d3d1);
    border-radius: 4px;
    background: #fff;
    padding: 0.4rem 0.55rem;
    font-size: 0.82rem;
    color: var(--stone-700);
}

.menu-toggle {
    display: none;
    margin-left: auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--stone-200);
    border-radius: 4px;
    background: #fff;
    padding: 0.5rem;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--stone-700);
}

.mobile-nav {
    display: none;
    border-top: 1px solid var(--stone-200);
    background: #fff;
}

.mobile-nav.open {
    display: block;
}

.mobile-link {
    display: block;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--stone-100);
    color: var(--stone-700);
}

.mobile-link.active {
    color: var(--amber-800);
    background: var(--amber-100);
}

.site-main {
    padding-top: 78px;
}

.message-wrap {
    margin-top: 1rem;
}

.message {
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.message-success {
    background: #ecfdf5;
    border: 1px solid #6ee7b7;
    color: #047857;
}

.message-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #b91c1c;
}

.hero-section {
    position: relative;
    min-height: calc(85vh - 78px);
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-slider {
    position: absolute;
    inset: 0;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1s ease, transform 6s ease;
}

.hero-slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1.1);
}

.hero-fallback {
    background: linear-gradient(140deg, #312e2b, #0f172a);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(28, 25, 23, 0.58), rgba(28, 25, 23, 0.35) 45%, rgba(250, 250, 249, 0.95));
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 760px;
    text-align: center;
    color: #fff;
}

.hero-content h1 {
    font-size: clamp(2rem, 6vw, 4.5rem);
    letter-spacing: 0.04em;
}

.hero-content p {
    font-size: clamp(1rem, 2.4vw, 1.4rem);
    color: #f5f5f4;
}

.hero-vertical-text {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.2em;
    z-index: 2;
}

.hero-slider-cms-actions {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 4;
    gap: 0.45rem;
    display: none;
}

.hero-slide-delete-button {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 4;
    display: none;
}

body.cms-edit-mode .hero-slider-cms-actions,
body.cms-edit-mode .hero-slide-delete-button {
    display: inline-flex;
}

.accent-line {
    width: 64px;
    height: 3px;
    border-radius: 999px;
    background: var(--amber-700);
    margin: 0 auto 1rem;
}

.section {
    padding: 5rem 0;
}

.section-white {
    background: #fff;
}

.section-cta {
    color: #fff;
    background: linear-gradient(130deg, var(--amber-900), var(--amber-800));
}

.section-dark {
    color: #fff;
    background: linear-gradient(140deg, var(--stone-900), var(--stone-800));
}

.page-hero {
    padding: 5rem 0;
    color: #fff;
    background: linear-gradient(130deg, var(--amber-900), var(--amber-800));
}

.center {
    text-align: center;
}

.section-header {
    margin-bottom: 2.3rem;
}

.section-header.center {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.section-header p,
.lead {
    color: var(--stone-600);
}

.section-cta p,
.section-dark p,
.page-hero p {
    color: rgba(255, 255, 255, 0.88);
}

.card-grid {
    display: grid;
    gap: 1.25rem;
}

.card-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    background: #fff;
    border: 1px solid var(--stone-200);
    border-radius: 6px;
    padding: 1.4rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: var(--amber-900);
    background: var(--amber-100);
    margin-bottom: 0.8rem;
}

.card-meta {
    color: var(--amber-800);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.split-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 2rem;
}

.split-layout.reverse article {
    order: 2;
}

.split-layout.reverse > div {
    order: 1;
}

.cover-image {
    width: 100%;
    border-radius: 6px;
    min-height: 280px;
    object-fit: cover;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
}

.mosaic {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.mosaic-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 6px;
}

.btn {
    display: inline-block;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.78rem 1.4rem;
    transition: all 0.2s ease;
}

.btn-primary {
    color: #fff;
    background: var(--amber-800);
}

.btn-primary:hover {
    background: var(--amber-900);
}

.btn-light {
    color: var(--amber-900);
    background: #fff;
}

.btn-light:hover {
    background: var(--stone-100);
}

.text-link {
    color: var(--amber-800);
    font-weight: 600;
}

.timeline-list {
    display: grid;
    gap: 1rem;
}

.timeline-card {
    background: #fff;
    border: 1px solid var(--stone-200);
    border-radius: 6px;
    padding: 1rem 1.2rem;
}

.timeline-year {
    color: var(--amber-800);
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.timeline-meta {
    color: var(--stone-600);
    margin-bottom: 0.35rem;
}

.project-card {
    border: 1px solid var(--stone-200);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.project-cover {
    position: relative;
    height: 230px;
}

.project-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-tag {
    position: absolute;
    left: 1rem;
    top: 1rem;
    background: var(--amber-800);
    color: #fff;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

.project-body {
    padding: 1rem 1.1rem;
}

.project-location {
    color: var(--stone-600);
    font-size: 0.92rem;
    margin-bottom: 0.6rem;
}

.project-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    margin-top: 0.8rem;
}

.projects-cms-actions {
    margin: 0 0 1rem;
    display: flex;
    justify-content: flex-end;
}

.news-toolbar {
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.7rem;
}

.news-toolbar-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.news-pagination {
    margin-top: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.news-page-link {
    border-radius: 6px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #ffffff;
    color: var(--stone-700);
    font-size: 0.84rem;
    padding: 0.38rem 0.65rem;
}

.news-page-link.active {
    background: var(--amber-800);
    border-color: var(--amber-800);
    color: #ffffff;
}

.news-form-help {
    margin: 0.8rem 0 0;
    color: var(--stone-600);
    font-size: 0.82rem;
}

.news-detail-cover-wrap {
    max-width: 960px;
    margin: 0 auto 1rem;
}

.news-detail-cover-actions {
    margin-top: 0.7rem;
    display: flex;
    justify-content: flex-end;
}

.news-cover-delete-button {
    display: none;
}

body.cms-edit-mode .news-cover-delete-button {
    display: inline-flex;
}

.news-detail-article {
    max-width: 960px;
    margin: 0 auto;
}

body.cms-project-modal-open {
    overflow: hidden;
}

.project-create-modal {
    position: fixed;
    inset: 0;
    z-index: 85;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(28, 25, 23, 0.72);
}

.project-create-modal.open {
    display: flex;
}

.project-create-dialog {
    width: min(860px, 96vw);
    max-height: 94vh;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--stone-200);
    background: #fff;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.project-create-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--stone-200);
}

.project-create-header h3 {
    margin: 0;
    font-size: 1.05rem;
}

.project-create-form {
    padding: 1rem;
}

.project-create-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
}

.project-create-grid label {
    display: grid;
    gap: 0.35rem;
    color: var(--stone-700);
    font-size: 0.84rem;
}

.project-create-grid label.full {
    grid-column: 1 / -1;
}

.project-create-grid input,
.project-create-grid select,
.project-create-grid textarea {
    width: 100%;
    border: 1px solid var(--stone-300, #d6d3d1);
    border-radius: 6px;
    padding: 0.65rem 0.7rem;
    font: inherit;
}

.project-create-grid textarea {
    resize: vertical;
}

.project-cover-preview-wrap {
    margin-top: 0.85rem;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    background: var(--stone-100);
    padding: 0.6rem;
}

.project-cover-preview-wrap img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 6px;
}

.project-create-error {
    margin-top: 0.7rem;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 0.84rem;
    padding: 0.55rem 0.7rem;
}

.project-create-actions {
    margin-top: 0.9rem;
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.project-meta-line {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
}

.project-detail-summary {
    max-width: 960px;
    margin: 0 auto;
}

.project-detail-sections {
    display: grid;
    gap: 1.2rem;
}

.project-section-cms-actions {
    margin: 0 0 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.project-gallery-cms-actions {
    margin: 0 0 0.8rem;
    display: flex;
    justify-content: flex-end;
}

.project-section-create-button,
.project-section-delete-button,
.project-gallery-create-button,
.project-gallery-delete-button {
    display: none;
}

body.cms-edit-mode .project-section-create-button,
body.cms-edit-mode .project-section-delete-button,
body.cms-edit-mode .project-gallery-create-button,
body.cms-edit-mode .project-gallery-delete-button {
    display: inline-flex;
}

.project-detail-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
}

.project-section-card-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    margin: -0.25rem 0 0.1rem;
}

.project-detail-section.layout-text_right .project-detail-text {
    order: 2;
}

.project-detail-section.layout-text_right .project-detail-media {
    order: 1;
}

.project-detail-section.layout-text_only {
    grid-template-columns: 1fr;
}

.project-detail-section.layout-image_only {
    grid-template-columns: 1fr;
}

.project-detail-section.layout-image_only .project-detail-media {
    width: 100%;
}

.project-waterfall {
    column-count: 3;
    column-gap: 1rem;
}

.waterfall-item {
    position: relative;
    display: inline-block;
    width: 100%;
    margin: 0 0 1rem;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--stone-200);
    background: #fff;
}

.waterfall-item img {
    width: 100%;
    height: auto;
    display: block;
}

.waterfall-item figcaption {
    padding: 0.6rem 0.7rem;
    color: var(--stone-600);
    font-size: 0.85rem;
}

.project-gallery-item-actions {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 2;
    display: flex;
    justify-content: flex-end;
}

.stat-card {
    text-align: center;
    border: 1px solid #fcdcb4;
    border-radius: 8px;
    background: #fff8eb;
    padding: 1.4rem 1rem;
}

.stat-value {
    color: var(--amber-900);
    font-size: 2rem;
    font-family: "Noto Serif SC", "Noto Serif JP", serif;
}

.stat-label {
    color: var(--stone-700);
}

.impact-summary {
    margin-top: 1.6rem;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    padding: 1.2rem;
    background: #fff;
}

.contact-list {
    display: grid;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
}

.contact-item {
    background: #fff;
    border: 1px solid var(--stone-200);
    border-radius: 6px;
    padding: 0.9rem 1rem;
}

.contact-item h3 {
    margin-bottom: 0.2rem;
}

.contact-item p {
    margin-bottom: 0.2rem;
}

.contact-item small {
    color: var(--stone-600);
}

.contact-form-panel {
    background: #fff;
    border: 1px solid var(--stone-200);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    padding: 1.4rem;
}

.contact-form {
    display: grid;
    gap: 0.55rem;
}

.contact-form label {
    font-weight: 600;
    color: var(--stone-700);
    margin-top: 0.55rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border: 1px solid var(--stone-300, #d6d3d1);
    border-radius: 5px;
    padding: 0.7rem 0.75rem;
    font: inherit;
    background: #fff;
}

.contact-form textarea {
    resize: vertical;
}

.field-error {
    color: #b91c1c;
    font-size: 0.82rem;
}

.map-placeholder {
    min-height: 220px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--stone-400);
    border-radius: 10px;
    background: #fff;
    color: var(--stone-600);
    text-align: center;
    padding: 1rem;
}

.site-footer {
    background: var(--stone-900);
    color: #d6d3d1;
    padding-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.2rem;
}

.site-footer h3 {
    color: #fff;
    font-size: 1.05rem;
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.35rem;
}

.footer-copy {
    border-top: 1px solid #3b3734;
    text-align: center;
    margin-top: 1.3rem;
    padding: 1rem 0 1.4rem;
    color: #a8a29e;
    font-size: 0.84rem;
}

.cms-toolbar {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--stone-200);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.cms-toolbar-button,
.cms-toolbar-link {
    border-radius: 6px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #fff;
    color: var(--stone-700);
    font-size: 0.82rem;
    padding: 0.42rem 0.7rem;
}

.cms-toolbar-button {
    cursor: pointer;
}

.cms-toolbar-link {
    text-decoration: none;
}

.cms-toolbar-status {
    color: var(--stone-600);
    font-size: 0.76rem;
    max-width: 14rem;
}

.cms-toolbar-status.is-error {
    color: #b91c1c;
}

.cms-ai-translate-button {
    margin-left: 0.4rem;
    border-radius: 999px;
    border: 1px solid var(--amber-700);
    background: #fff7ed;
    color: var(--amber-900);
    font-size: 0.72rem;
    line-height: 1;
    padding: 0.24rem 0.5rem;
    display: none;
    cursor: pointer;
    vertical-align: middle;
}

.cms-ai-translate-button:hover {
    background: #ffedd5;
}

body.cms-edit-mode .cms-ai-translate-button {
    display: inline-flex;
}

body.cms-edit-mode .cms-editable[data-cms-id] {
    outline: 2px dashed rgba(180, 83, 9, 0.6);
    outline-offset: 2px;
    border-radius: 4px;
    background: rgba(255, 251, 235, 0.76);
    cursor: text;
}

body.cms-edit-mode .cms-richtext-editable.cms-richtext-editable-active {
    cursor: pointer;
}

body.cms-edit-mode .cms-editable[data-cms-id]:focus {
    outline: 2px solid rgba(146, 64, 14, 0.95);
}

body.cms-edit-mode .cms-editable-image.cms-image-editable-active {
    outline: 3px dashed rgba(180, 83, 9, 0.7);
    outline-offset: -4px;
    cursor: pointer;
}

.cms-saving {
    opacity: 0.6;
}

body.cms-image-editor-open {
    overflow: hidden;
}

body.cms-ai-translate-open {
    overflow: hidden;
}

.cms-ai-translate-modal {
    position: fixed;
    inset: 0;
    z-index: 83;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(28, 25, 23, 0.74);
    padding: 1rem;
}

.cms-ai-translate-modal.open {
    display: flex;
}

.cms-ai-translate-dialog {
    width: min(460px, 94vw);
    border-radius: 12px;
    border: 1px solid var(--stone-200);
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.cms-ai-translate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--stone-200);
}

.cms-ai-translate-header h3 {
    margin: 0;
    font-size: 1rem;
}

.cms-ai-translate-body {
    padding: 1rem;
}

.cms-ai-translate-help {
    margin: 0 0 0.65rem;
    color: var(--stone-700);
    font-size: 0.84rem;
}

.cms-image-editor-modal {
    position: fixed;
    inset: 0;
    z-index: 82;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(28, 25, 23, 0.74);
    padding: 1rem;
}

.cms-image-editor-modal.open {
    display: flex;
}

body.cms-richtext-editor-open {
    overflow: hidden;
}

.cms-richtext-modal {
    position: fixed;
    inset: 0;
    z-index: 81;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(28, 25, 23, 0.74);
    padding: 1rem;
}

.cms-richtext-modal.open {
    display: flex;
}

.cms-richtext-dialog {
    width: min(980px, 96vw);
    max-height: 94vh;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--stone-200);
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.cms-richtext-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--stone-200);
}

.cms-richtext-header h3 {
    margin: 0;
    font-size: 1.02rem;
}

.cms-richtext-body {
    padding: 1rem;
}

.cms-richtext-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.cms-richtext-editor-area {
    margin-top: 0.9rem;
    min-height: 320px;
    border-radius: 10px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #ffffff;
    padding: 0.8rem;
    overflow: auto;
    line-height: 1.7;
}

.cms-richtext-editor-area:focus {
    outline: 2px solid rgba(146, 64, 14, 0.35);
    outline-offset: 1px;
}

.cms-richtext-editor-area img {
    max-width: 100%;
    height: auto;
}

.cms-richtext-help {
    margin: 0.65rem 0 0;
    color: var(--stone-600);
    font-size: 0.84rem;
}

.cms-image-editor-dialog {
    width: min(940px, 96vw);
    max-height: 94vh;
    overflow: auto;
    border-radius: 12px;
    border: 1px solid var(--stone-200);
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.cms-image-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--stone-200);
}

.cms-image-editor-header h3 {
    margin: 0;
    font-size: 1.02rem;
}

.cms-editor-icon-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #ffffff;
    color: var(--stone-700);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.cms-image-editor-body {
    padding: 1rem;
}

.cms-editor-canvas-wrap {
    border-radius: 10px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #111111;
    padding: 0.75rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

#cms-image-editor-canvas {
    border-radius: 8px;
    max-width: 100%;
    cursor: grab;
}

#cms-image-editor-canvas:active {
    cursor: grabbing;
}

.cms-editor-help {
    margin: 0.65rem 0 0;
    color: var(--stone-600);
    font-size: 0.84rem;
}

.cms-editor-control-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
    margin-top: 0.85rem;
}

.cms-editor-control {
    display: grid;
    gap: 0.35rem;
    color: var(--stone-700);
    font-size: 0.84rem;
}

.cms-editor-control input,
.cms-editor-control select {
    width: 100%;
}

.cms-editor-control em {
    color: var(--stone-600);
    font-style: normal;
    font-size: 0.78rem;
}

.cms-editor-actions {
    margin-top: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.55rem;
}

.cms-editor-button {
    border-radius: 6px;
    border: 1px solid var(--stone-300, #d6d3d1);
    background: #ffffff;
    color: var(--stone-700);
    font-size: 0.84rem;
    padding: 0.46rem 0.78rem;
    cursor: pointer;
}

.cms-editor-button.primary {
    background: var(--amber-800);
    border-color: var(--amber-800);
    color: #ffffff;
}

.cms-editor-button.primary:hover {
    background: var(--amber-900);
    border-color: var(--amber-900);
}

.cms-editor-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 990px) {
    .desktop-nav,
    .language-form {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-vertical-text {
        display: none;
    }

    .card-grid-3,
    .card-grid-2,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .project-detail-section {
        grid-template-columns: 1fr;
    }

    .project-create-grid {
        grid-template-columns: 1fr;
    }

    .project-detail-section.layout-text_right .project-detail-text,
    .project-detail-section.layout-text_right .project-detail-media {
        order: initial;
    }

    .project-waterfall {
        column-count: 2;
    }

    .split-layout.reverse article,
    .split-layout.reverse > div {
        order: initial;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .cms-toolbar {
        left: 0.8rem;
        right: 0.8rem;
        bottom: 0.8rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .cms-editor-control-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .section,
    .page-hero {
        padding: 3.5rem 0;
    }

    .hero-section {
        min-height: calc(75vh - 78px);
    }

    .project-waterfall {
        column-count: 1;
    }
}
