:root {
  --bg: #f6f2e6;
  --bg-soft: #fbfaf6;
  --card: rgba(255, 255, 255, 0.84);
  --white: #fffefb;
  --text: #242424;
  --text-soft: #68645a;
  --line: #d8cfbd;
  --line-strong: #c7bc9f;
  --green: #0b0b0b;
  --green-deep: #000000;
  --green-soft: #b49307;
  --gold: #c4a000;
  --gold-soft: #efe3ad;
  --danger: #d56557;
  --shadow-sm: 0 10px 30px rgba(12, 12, 12, 0.06);
  --shadow-md: 0 18px 46px rgba(12, 12, 12, 0.12);
  --shadow-lg: 0 30px 80px rgba(12, 12, 12, 0.17);
  --radius-sm: 14px;
  --radius: 22px;
  --radius-lg: 30px;
  --ease: 0.32s cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  width: 100%;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top center, rgba(203, 185, 140, 0.13), transparent 34%),
    linear-gradient(180deg, #fbf8f1 0%, var(--bg) 100%);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
.hidden { display: none !important; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { appearance: none; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .46s ease, transform .46s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 247, 239, .92);
  border-bottom: 1px solid rgba(199, 188, 159, .55);
  backdrop-filter: blur(16px);
}
.header-green-band { height: 16px; background: linear-gradient(90deg, var(--green-deep), var(--green), #b59a14); }
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { display: flex; align-items: center; gap: 18px; min-width: 0; }
.brand-mark-wrap {
  width: 108px;
  height: 74px;
  border-radius: 18px;
  background: #fffefb;
  border: 1px solid rgba(196,160,0,.34);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 16px 38px rgba(12,12,12,.14);
  transition: transform var(--ease), box-shadow var(--ease);
}
.brand-mark-wrap:hover { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow-md); }
.brand-logo { width: 92px; height: 56px; object-fit: contain; }
.brand-title {
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 700;
  font-size: clamp(24px, 2.7vw, 34px);
  letter-spacing: clamp(4px, .68vw, 8px);
  line-height: 1;
  color: #141414;
  white-space: nowrap;
}
.brand-sub { margin-top: 10px; color: var(--green-soft); letter-spacing: 5px; font-size: 13px; font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.lang-btn, .access-btn, .logout-btn, .btn, .btn-add, .record-action {
  transition: transform var(--ease), box-shadow var(--ease), border-color var(--ease), background var(--ease), color var(--ease), opacity var(--ease);
}
.lang-btn, .access-btn, .logout-btn {
  border: 1px solid rgba(12, 12, 12, .22);
  background: rgba(255,255,255,.75);
  color: var(--text);
  min-width: 66px;
  height: 48px;
  padding: 0 18px;
  border-radius: 15px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(12,12,12,.04);
  font-weight: 500;
}
.lang-btn:hover, .access-btn:hover, .logout-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: rgba(12,12,12,.45); }
.lang-btn.active { background: linear-gradient(135deg, var(--green), var(--green-soft)); color: white; border-color: var(--green); }
.access-btn { min-width: 118px; }

.hero { position: relative; overflow: hidden; border-bottom: 1px solid rgba(199,188,159,.55); }
.hero-glow { position: absolute; inset: 0; background: radial-gradient(circle at center, rgba(203,185,140,.26), transparent 26%), radial-gradient(circle at center, rgba(12,12,12,.08), transparent 48%); pointer-events: none; }
.hero-inner { position: relative; max-width: 1160px; margin: 0 auto; padding: 78px 28px 88px; text-align: center; }
.hero-logo-wrap {
  width: 184px;
  height: 132px;
  margin: 0 auto 24px;
  border-radius: 28px;
  background: #fffefb;
  border: 1px solid rgba(196,160,0,.38);
  display: grid;
  place-items: center;
  box-shadow: 0 26px 60px rgba(12,12,12,.16);
  animation: floatLogo 5s ease-in-out infinite;
}
.hero-logo { width: 154px; height: 96px; object-fit: contain; }
@keyframes floatLogo { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid rgba(12,12,12,.55);
  color: var(--green);
  background: rgba(255,255,255,.62);
  font-size: 15px;
  letter-spacing: 4px;
  font-weight: 700;
  margin-bottom: 26px;
}
.hero-title { margin: 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: clamp(46px, 5.6vw, 82px); font-weight: 600; line-height: 1.06; color: #2c2e2c; }
.hero-title span { color: var(--green-soft); font-style: normal; }
.hero-desc { max-width: 940px; margin: 26px auto 0; color: var(--text-soft); font-size: 18px; line-height: 1.9; }

.progress-section { padding: 32px 20px 16px; }
.progress-wrap { max-width: 1020px; margin: 0 auto; display: grid; grid-template-columns: 56px 1fr 56px 1fr 56px 1fr 56px 1fr 56px; align-items: center; gap: 14px; }
.progress-item { text-align: center; min-width: 0; }
.progress-circle { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255,255,255,.82); display: grid; place-items: center; font-size: 26px; font-weight: 600; color: #3e413d; margin: 0 auto 10px; transition: transform var(--ease), background var(--ease), color var(--ease), box-shadow var(--ease), border-color var(--ease); }
.progress-label { color: var(--green-soft); font-size: 14px; font-weight: 500; }
.progress-line { height: 1px; background: linear-gradient(90deg, rgba(199,188,159,.8), rgba(199,188,159,.2)); transform: translateY(-18px); }
.progress-item.active .progress-circle, .progress-item.done .progress-circle { background: linear-gradient(135deg, var(--green), var(--green-soft)); border-color: var(--green); color: white; box-shadow: 0 14px 30px rgba(12,12,12,.18); transform: translateY(-2px); }

.form-shell { max-width: 1100px; margin: 0 auto; padding: 18px 20px 78px; }
.step { display: none; }
.step.active { display: block; animation: fadeSlide .38s ease; }
@keyframes fadeSlide { from { opacity: 0; transform: translateY(18px);} to { opacity: 1; transform: translateY(0);} }
.form-card, .record-card, .admin-head, .stat-card, .modal-card { background: rgba(255,255,255,.78); border: 1px solid rgba(203,185,140,.6); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); }
.form-card { border-radius: var(--radius-lg); padding: 32px 32px 28px; }
.card-header { display: flex; align-items: center; gap: 18px; padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid rgba(199,188,159,.5); }
.card-number { min-width: 72px; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 56px; line-height: 1; color: rgba(203,185,140,.7); }
.card-header h2 { margin: 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 44px; font-weight: 600; line-height: 1.05; }
.card-header p { margin: 9px 0 0; color: var(--text-soft); font-size: 17px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px 20px; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; margin-bottom: 10px; font-size: 13px; letter-spacing: 3px; font-weight: 700; color: #50534c; }
.required { color: #d9534f; }
input[type="text"], input[type="password"], input[type="file"], input[type="date"], select, textarea { width: 100%; max-width: 100%; min-height: 56px; border-radius: 18px; border: 1px solid rgba(199,188,159,.72); background: rgba(255,255,255,.96); padding: 0 18px; color: var(--text); outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.9); transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease), background var(--ease); }
input[type="file"] { padding-top: 14px; padding-bottom: 14px; min-height: auto; }
textarea { min-height: 120px; padding-top: 16px; padding-bottom: 16px; }
input::placeholder, textarea::placeholder { color: #aba28f; }
input:focus, select:focus, textarea:focus { border-color: rgba(12,12,12,.5); box-shadow: 0 0 0 4px rgba(12,12,12,.08); transform: translateY(-1px); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--green) 50%), linear-gradient(135deg, var(--green) 50%, transparent 50%); background-position: calc(100% - 24px) calc(50% - 3px), calc(100% - 18px) calc(50% - 3px); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; padding-right: 46px; }
.invalid { border-color: #d9534f !important; box-shadow: 0 0 0 4px rgba(217,83,79,.08) !important; }
.required-message { display: none; margin-top: 18px; color: #b84541; font-size: 14px; font-weight: 600; }
.required-message.show { display: block; }
.step-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; flex-wrap: wrap; }
.step-note { color: var(--text-soft); font-size: 15px; }
.btn, .btn-add, .record-action { border: 0; border-radius: 16px; cursor: pointer; font-weight: 700; }
.btn { min-height: 54px; padding: 0 22px; }
.btn:hover, .btn-add:hover, .record-action:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--green), var(--green-soft)); }
.btn-secondary { color: var(--green); background: rgba(255,255,255,.9); border: 1px solid rgba(12,12,12,.18); }
.btn-add { margin-top: 18px; min-height: 54px; padding: 0 22px; color: var(--green); background: linear-gradient(180deg, rgba(203,185,140,.18), rgba(203,185,140,.08)); border: 1px dashed rgba(12,12,12,.28); }
.dynamic-container { display: grid; gap: 16px; }
.dynamic-item { background: rgba(255,255,255,.64); border: 1px solid rgba(203,185,140,.42); border-radius: 22px; padding: 18px; animation: fadeSlide .3s ease; }
.btn-remove-item { margin-top: 14px; }

.site-footer { background: linear-gradient(180deg, #050505, #101010); color: rgba(255,255,255,.88); text-align: center; padding: 54px 20px 46px; }
.footer-logo-wrap { width: auto; height: auto; margin: 0 auto 18px; display: flex; justify-content: center; align-items: center; background: transparent; border-radius: 0; }
.footer-logo { width: 96px; height: 72px; object-fit: contain; border-radius: 0; background: transparent; }
.footer-brand { font-family: 'Montserrat', 'Inter', sans-serif; font-size: 34px; letter-spacing: 6px; }
.footer-sub { margin-top: 8px; letter-spacing: 4px; font-size: 12px; color: rgba(203,185,140,.94); }
.footer-copy { margin-top: 18px; color: rgba(255,255,255,.62); }

.admin-shell { max-width: 1160px; margin: 0 auto; padding: 30px 20px 90px; }
.admin-head { border-radius: var(--radius); padding: 26px 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.admin-kicker { font-size: 13px; letter-spacing: 4px; color: var(--green-soft); font-weight: 700; }
.admin-title { margin: 10px 0 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 52px; line-height: 1; }
.admin-note { margin: 16px 0 0; color: var(--text-soft); line-height: 1.8; max-width: 790px; }
.cloud-status { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(12,12,12,.06); color: var(--green); font-size: 14px; }
.cloud-status.error { background: rgba(213,101,87,.09); color: #a84239; }
.admin-top-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.admin-stats { margin-top: 20px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.stat-card { border-radius: var(--radius); padding: 28px; }
.stat-number { font-family: 'Montserrat', 'Inter', sans-serif; font-size: 56px; line-height: 1; color: var(--green-soft); }
.stat-label { margin-top: 14px; font-size: 14px; letter-spacing: 4px; font-weight: 700; color: #545651; }
.records-list { margin-top: 22px; display: grid; gap: 20px; }
.record-card { border-radius: 26px; padding: 26px; }
.record-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.record-name { margin: 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 36px; line-height: 1; }
.record-date { margin-top: 10px; color: var(--text-soft); }
.record-meta-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.record-source, .record-status { display: inline-flex; padding: 4px 10px; border-radius: 999px; background: rgba(12,12,12,.08); color: var(--green); font-size: 12px; font-weight: 700; }
.record-status.rejected { background: rgba(213,101,87,.12); color: #a84239; }
.record-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.record-action { min-height: 44px; padding: 0 16px; background: rgba(255,255,255,.88); border: 1px solid rgba(12,12,12,.16); }
.record-action.view { color: #8a6c1c; }
.record-action.print { color: var(--green-soft); }
.record-action.delete { color: var(--danger); border-color: rgba(213,101,87,.22); }
.record-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px 20px; padding-top: 22px; margin-top: 20px; border-top: 1px solid rgba(199,188,159,.5); }
.record-label { font-size: 13px; letter-spacing: 3px; font-weight: 700; color: #66685f; margin-bottom: 8px; }
.record-value { font-size: 18px; color: var(--text); word-break: break-word; }
.empty-state { border-radius: 24px; padding: 34px 24px; text-align: center; color: var(--text-soft); background: rgba(255,255,255,.74); border: 1px solid rgba(203,185,140,.55); }
.admin-filter { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.filter-btn { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(12,12,12,.16); background: rgba(255,255,255,.82); color: var(--text); cursor: pointer; font-weight: 700; transition: transform var(--ease), box-shadow var(--ease), background var(--ease), color var(--ease); }
.filter-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.filter-btn.active { background: linear-gradient(135deg, var(--green), var(--green-soft)); color: #fff; border-color: var(--green); }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8,18,14,.52); backdrop-filter: blur(6px); animation: fadeBackdrop .24s ease; }
@keyframes fadeBackdrop { from{opacity:0} to{opacity:1} }
.modal-card { position: relative; z-index: 1; width: 100%; border-radius: 30px; box-shadow: var(--shadow-lg); animation: popModal .28s ease; }
@keyframes popModal { from{opacity:0; transform:translateY(16px) scale(.97)} to{opacity:1; transform:translateY(0) scale(1)} }
.modal-card-sm { max-width: 520px; padding: 34px 28px 30px; }
.modal-card-lg { max-width: 1000px; padding: 34px 28px 28px; max-height: calc(100vh - 40px); overflow: auto; }
.modal-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; background: rgba(12,12,12,.06); color: #1e1f1e; font-size: 24px; transition: transform var(--ease), background var(--ease); }
.modal-close:hover { transform: rotate(90deg); background: rgba(12,12,12,.12); }
.modal-title { margin: 0; font-size: 40px; font-family: 'Montserrat', 'Inter', sans-serif; }
.modal-sub { margin: 12px 0 18px; color: var(--text-soft); line-height: 1.8; }
.full-btn { width: 100%; margin-top: 8px; }
.error-text { min-height: 22px; color: #bf4e49; margin: 8px 0 0; font-size: 14px; }
.detail-main-title { margin: 0; font-family: 'Montserrat', 'Inter', sans-serif; font-size: 40px; }
.detail-date { margin-top: 10px; color: var(--text-soft); }
.detail-wrap { display: grid; gap: 18px; min-width: 0; }
.detail-admin-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; padding: 14px 16px; border: 1px solid rgba(203,185,140,.48); border-radius: 18px; background: rgba(255,255,255,.64); }
.detail-status-pill { display: inline-flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 999px; background: rgba(12,12,12,.08); color: var(--green); font-size: 13px; }
.detail-status-pill strong { letter-spacing: 2px; }
.detail-status-pill.rejected { background: rgba(213,101,87,.12); color: #a84239; }
.detail-status-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.detail-status-toggle { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; cursor: pointer; }
.detail-status-toggle input { width: 18px; height: 18px; accent-color: var(--green); }
.detail-block { min-width: 0; max-width: 100%; border: 1px solid rgba(203,185,140,.48); border-radius: 22px; padding: 16px; background: rgba(255,255,255,.6); }
.detail-block-title { margin-bottom: 12px; color: var(--green-soft); letter-spacing: 3px; font-size: 13px; font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; min-width: 0; }
.detail-grid > div { min-width: 0; padding: 14px 15px; border-radius: 16px; background: rgba(255,255,255,.82); border: 1px solid rgba(203,185,140,.42); }
.detail-grid strong { display: block; margin-bottom: 8px; font-size: 12px; letter-spacing: 2px; color: #676960; }
.detail-grid span { line-height: 1.7; word-break: break-word; }
.detail-table-wrap { display: block; width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; }
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th, .detail-table td { border: 1px solid rgba(203,185,140,.52); padding: 12px; text-align: left; vertical-align: top; }
.detail-table th { background: rgba(203,185,140,.13); }
.detail-doc-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.detail-bottom-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.file-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.file-card { border: 1px solid rgba(203,185,140,.52); border-radius: 18px; background: rgba(255,255,255,.76); padding: 12px; overflow: hidden; }
.file-card img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 14px; background: #f8f4eb; border: 1px solid rgba(203,185,140,.3); }
.file-name { margin-top: 10px; color: var(--green); font-weight: 700; font-size: 14px; word-break: break-word; }
.file-link { display: inline-block; margin-top: 8px; color: #8a6c1c; font-weight: 700; text-decoration: none; }

@media (max-width: 1024px) {
  .header-inner { padding: 20px 20px; }
  .brand-title { font-size: 28px; letter-spacing: 6px; }
  .hero-inner { padding: 70px 24px 76px; }
  .card-header h2 { font-size: 42px; }
  .admin-head, .record-top { display: grid; grid-template-columns: 1fr; }
  .form-grid, .record-grid, .detail-grid, .file-grid { grid-template-columns: 1fr; }
  .record-actions, .admin-top-actions { justify-content: flex-start; }
}

@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  body { background: #fbf8f1; }
  .header-green-band { height: 12px; }
  .site-header { position: relative; }
  .header-inner { padding: 16px 14px 18px; flex-direction: column; align-items: stretch; gap: 14px; }
  .brand { gap: 12px; width: 100%; }
  .brand-mark-wrap { width: 84px; height: 58px; border-radius: 14px; }
  .brand-logo { width: 68px; height: 42px; }
  .brand-title { white-space: normal; font-size: 21px; letter-spacing: 3.2px; line-height: 1.05; }
  .brand-sub { margin-top: 6px; font-size: 10px; letter-spacing: 2.8px; }
  .header-actions { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; width: 100%; }
  .lang-btn, .access-btn, .logout-btn { width: 100%; min-width: 0; height: 43px; padding: 0 6px; border-radius: 13px; font-size: 13px; }
  .hero-inner { padding: 38px 14px 42px; }
  .hero-logo-wrap { width: 128px; height: 92px; border-radius: 20px; margin-bottom: 18px; }
  .hero-logo { width: 106px; height: 66px; }
  .hero-chip { min-height: 40px; padding: 0 16px; font-size: 11px; letter-spacing: 2.6px; margin-bottom: 18px; }
  .hero-title { font-size: clamp(34px, 10.4vw, 44px); line-height: 1.08; }
  .hero-desc { margin-top: 18px; font-size: 15px; line-height: 1.82; }
  .progress-section { padding: 22px 10px 8px; }
  .progress-wrap { max-width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 6px; }
  .progress-line { display: none; }
  .progress-circle { width: 40px; height: 40px; font-size: 18px; margin-bottom: 7px; }
  .progress-label { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .form-shell { padding: 12px 10px 56px; }
  .form-card { padding: 22px 16px 20px; border-radius: 22px; }
  .card-header { align-items: flex-start; gap: 12px; margin-bottom: 20px; padding-bottom: 18px; }
  .card-number { min-width: 44px; font-size: 38px; }
  .card-header h2 { font-size: 30px; line-height: 1.08; }
  .card-header p { font-size: 14px; line-height: 1.65; margin-top: 8px; }
  .form-grid { grid-template-columns: 1fr; gap: 18px; }
  .dynamic-item { padding: 14px; border-radius: 18px; }
  .field label { font-size: 11px; letter-spacing: 2px; line-height: 1.5; }
  input[type="text"], input[type="password"], input[type="file"], input[type="date"], select, textarea { min-height: 54px; font-size: 16px; border-radius: 14px; padding-left: 15px; padding-right: 44px; }
  input[type="file"] { padding-right: 15px; }
  .step-footer { flex-direction: column; align-items: stretch; }
  .step-note { order: -1; text-align: center; font-size: 14px; }
  .btn, .btn-add, .record-action { width: 100%; min-height: 52px; }
  .site-footer { padding: 40px 16px 36px; }
  .footer-logo { width: 82px; height: 60px; }
  .footer-brand { font-size: 28px; letter-spacing: 4px; }
  .footer-sub { font-size: 10px; letter-spacing: 2px; }
  .footer-copy { font-size: 13px; line-height: 1.7; }
  .admin-shell { padding: 18px 10px 56px; }
  .admin-head, .record-card, .stat-card { padding: 18px 16px; border-radius: 20px; }
  .admin-title { font-size: 38px; }
  .admin-note { font-size: 14px; }
  .admin-stats { grid-template-columns: 1fr; gap: 12px; }
  .admin-filter { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .filter-btn { width: 100%; min-height: 46px; }
  .stat-number { font-size: 42px; }
  .record-name { font-size: 30px; }
  .record-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .record-grid { grid-template-columns: 1fr; gap: 16px; }
  .modal { padding: 0; align-items: flex-start; place-items: start center; overflow-y: auto; }
  .modal-card-sm, .modal-card-lg {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 12px auto;
    padding: 22px 16px 18px;
    border-radius: 22px;
    box-sizing: border-box;
  }
  .modal-card-lg { max-height: calc(100dvh - 24px); overflow: auto; }
  .modal-close { top: 10px; right: 10px; width: 38px; height: 38px; z-index: 3; }
  .modal-title { font-size: 32px; }
  .detail-main-title { font-size: clamp(28px, 9vw, 38px); line-height: 1.05; word-break: keep-all; padding-right: 34px; }
  .detail-admin-tools { display: grid; grid-template-columns: 1fr; padding: 12px; }
  .detail-status-actions { display: grid; grid-template-columns: 1fr; justify-content: stretch; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-block { padding: 14px; border-radius: 18px; }
  .detail-table { min-width: 560px; }
  .detail-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .detail-doc-actions, .detail-bottom-actions { display: grid; grid-template-columns: 1fr; }
  .file-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .brand-title { font-size: 18px; letter-spacing: 2.2px; }
  .hero-title { font-size: 34px; }
  .hero-desc { font-size: 14px; }
  .progress-circle { width: 36px; height: 36px; font-size: 16px; }
  .progress-label { font-size: 10px; }
  .header-actions { gap: 6px; }
  .lang-btn, .access-btn, .logout-btn { font-size: 12px; }
  .form-card { padding: 20px 14px; }
  .card-header h2 { font-size: 27px; }
}


#mobilePrintView .print-toolbar {
  justify-content: center;
  flex-wrap: wrap;
}

#mobilePrintView .print-toolbar-btn {
  flex: 1 1 140px;
  max-width: 260px;
}

#mobilePrintView .print-toolbar-btn[disabled] {
  opacity: .65;
  cursor: progress;
}

@media (max-width: 520px) {
  #mobilePrintView {
    padding: 12px;
  }

  #mobilePrintView .print-toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  #mobilePrintView .print-toolbar-btn {
    max-width: none;
    width: 100%;
    min-height: 54px;
    font-size: 16px;
  }

  #mobilePrintView .print-only-btn {
    grid-column: 1 / -1;
  }

  #mobilePrintView .print-mobile-note {
    font-size: 14px;
    line-height: 1.8;
  }
}

/* FAITH HOME refined minimal theme */
:root {
  --bg: #f8f6ef;
  --bg-soft: #fbfaf6;
  --card: rgba(255, 255, 255, 0.88);
  --white: #fffefa;
  --text: #181614;
  --text-soft: #6f6a60;
  --line: #ded6c5;
  --line-strong: #c8bb9a;
  --green: #151311;
  --green-deep: #151311;
  --green-soft: #9b7d08;
  --gold: #b89509;
  --gold-soft: #eee3bd;
  --shadow-sm: 0 16px 38px rgba(22, 18, 12, 0.055);
  --shadow-md: 0 22px 52px rgba(22, 18, 12, 0.075);
  --shadow-lg: 0 28px 76px rgba(22, 18, 12, 0.12);
  --font-mincho: "Noto Serif JP", "Yu Mincho", YuMincho, "Hiragino Mincho ProN", "Noto Serif", serif;
}

html { font-size: 15px; }
body {
  background: #faf8f2;
  color: var(--text);
  font-family: var(--font-mincho);
  font-size: 15px;
  line-height: 1.78;
}
body * { letter-spacing: 0; }
button, input, select, textarea { font-family: var(--font-mincho); }

.site-header {
  background: rgba(250, 248, 242, .96);
  border-bottom: 1px solid rgba(184, 149, 9, .18);
}
.header-green-band { height: 1px; background: #b89509; }
.header-inner {
  max-width: 1240px;
  padding: 28px 42px;
}
.brand { gap: 22px; }
.brand-mark-wrap,
.hero-logo-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand-mark-wrap {
  width: 96px;
  height: 62px;
}
.brand-mark-wrap:hover {
  transform: none;
  box-shadow: none;
}
.brand-logo {
  width: 96px;
  height: 62px;
}
.brand-title,
.footer-brand,
.admin-title,
.record-name,
.modal-title,
.detail-main-title,
.card-header h2,
.card-number,
.stat-number,
.hero-title {
  font-family: var(--font-mincho);
  letter-spacing: 0;
}
.brand-title {
  font-size: 28px;
  font-weight: 500;
  color: #171411;
}
.brand-sub {
  margin-top: 7px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
}
.lang-btn,
.access-btn,
.logout-btn,
.btn,
.btn-add,
.record-action,
.filter-btn {
  border-radius: 4px;
  box-shadow: none;
  font-weight: 500;
  letter-spacing: 0;
}
.lang-btn,
.access-btn,
.logout-btn {
  min-width: 58px;
  height: 44px;
  border-color: rgba(21, 19, 17, .18);
  background: rgba(255, 254, 250, .86);
}
.lang-btn.active,
.filter-btn.active,
.progress-item.active .progress-circle,
.progress-item.done .progress-circle,
.btn-primary {
  background: #151311;
  border-color: #151311;
  color: #fffefa;
  box-shadow: none;
}

.hero {
  border-bottom: 1px solid rgba(184, 149, 9, .14);
}
.hero-glow { display: none; }
.hero-inner {
  max-width: 900px;
  padding: 92px 30px 96px;
}
.hero-logo-wrap {
  width: 146px;
  height: 96px;
  margin-bottom: 32px;
  animation: none;
}
.hero-logo {
  width: 146px;
  height: 96px;
}
.hero-chip {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  margin-bottom: 26px;
}
.hero-title {
  font-size: 36px;
  font-weight: 400;
  line-height: 1.34;
  color: #171411;
}
.hero-title span {
  color: #171411;
  font-weight: 500;
}
.hero-desc {
  max-width: 720px;
  margin-top: 28px;
  font-size: 15px;
  line-height: 2.05;
}

.progress-section { padding: 34px 20px 8px; }
.progress-wrap {
  max-width: 840px;
  grid-template-columns: 40px 1fr 40px 1fr 40px 1fr 40px 1fr 40px;
  gap: 12px;
}
.progress-circle {
  width: 40px;
  height: 40px;
  font-size: 18px;
  font-weight: 400;
  margin-bottom: 8px;
}
.progress-label {
  color: var(--text-soft);
  font-size: 12px;
}
.progress-line {
  background: rgba(184, 149, 9, .2);
  transform: translateY(-15px);
}

.form-shell {
  max-width: 980px;
  padding: 28px 22px 96px;
}
.form-card,
.record-card,
.admin-head,
.stat-card,
.modal-card,
.dynamic-item,
.detail-block,
.detail-grid > div,
.file-card,
.empty-state {
  border-color: rgba(184, 149, 9, .22);
  background: rgba(255, 254, 250, .82);
  box-shadow: var(--shadow-sm);
}
.form-card {
  border-radius: 12px;
  padding: 38px 36px 34px;
}
.card-header {
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom-color: rgba(184, 149, 9, .16);
}
.card-number {
  min-width: 48px;
  font-size: 34px;
  font-weight: 300;
  color: rgba(184, 149, 9, .72);
}
.card-header h2 {
  font-size: 30px;
  font-weight: 400;
}
.card-header p {
  margin-top: 7px;
  font-size: 14px;
}
.form-grid { gap: 20px 18px; }
.field label,
.record-label,
.detail-grid strong,
.detail-block-title,
.admin-kicker,
.stat-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}
input[type="text"],
input[type="password"],
input[type="file"],
input[type="date"],
select,
textarea {
  min-height: 50px;
  border-radius: 4px;
  border-color: rgba(184, 149, 9, .26);
  background: rgba(255, 255, 255, .74);
  font-size: 15px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: rgba(184, 149, 9, .58);
  box-shadow: 0 0 0 3px rgba(184, 149, 9, .08);
  transform: none;
}
select {
  background-image: none;
  padding-right: 18px;
}
.btn,
.btn-add,
.record-action {
  min-height: 48px;
  padding: 0 18px;
}
.btn-secondary,
.btn-add {
  color: var(--text);
  background: rgba(255, 254, 250, .78);
  border: 1px solid rgba(184, 149, 9, .24);
}

.site-footer {
  background: #151311;
  color: rgba(255, 254, 250, .86);
  padding: 72px 20px 58px;
}
.footer-logo-wrap { margin-bottom: 22px; }
.footer-logo {
  width: 166px;
  height: 114px;
}
.footer-brand {
  font-size: 26px;
  font-weight: 400;
}
.footer-sub {
  color: rgba(184, 149, 9, .86);
  font-size: 10px;
  letter-spacing: 0;
}
.footer-copy {
  color: rgba(255, 254, 250, .56);
  font-size: 12px;
}

.admin-shell { max-width: 1080px; padding-top: 34px; }
.admin-head {
  border-radius: 12px;
  padding: 28px 30px;
}
.admin-title { font-size: 34px; font-weight: 400; }
.admin-note { font-size: 14px; }
.stat-card {
  border-radius: 10px;
  padding: 24px;
}
.stat-number {
  font-size: 36px;
  font-weight: 300;
}
.record-card {
  border-radius: 12px;
  padding: 26px;
}
.record-name {
  font-size: 30px;
  font-weight: 400;
}
.record-value { font-size: 15px; }
.record-action.view,
.record-action.print {
  color: var(--text);
}
.filter-btn {
  min-height: 40px;
  padding: 0 14px;
}

.modal-card { border-radius: 14px; }
.modal-card-sm { padding: 30px 26px 28px; }
.modal-card-lg { padding: 30px 26px 28px; }
.modal-title,
.detail-main-title {
  font-size: 30px;
  font-weight: 400;
}
.detail-block { border-radius: 10px; }
.detail-grid > div { border-radius: 6px; }
.detail-table th,
.detail-table td {
  padding: 10px;
  font-size: 13px;
}

@media (max-width: 1024px) {
  .header-inner { padding: 24px 24px; }
  .brand-title { font-size: 24px; }
  .hero-title { font-size: 40px; }
  .card-header h2 { font-size: 28px; }
}

@media (max-width: 768px) {
  body { background: #faf8f2; }
  .header-green-band { height: 1px; }
  .header-inner {
    padding: 22px 18px 20px;
    gap: 18px;
  }
  .brand {
    justify-content: center;
    gap: 14px;
  }
  .brand-mark-wrap {
    width: 78px;
    height: 50px;
  }
  .brand-logo {
    width: 78px;
    height: 50px;
  }
  .brand-title {
    font-size: 20px;
    line-height: 1.18;
  }
  .brand-sub { font-size: 10px; }
  .header-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
  .lang-btn,
  .access-btn,
  .logout-btn {
    height: 42px;
    font-size: 13px;
  }
  .hero-inner { padding: 58px 20px 62px; }
  .hero-logo-wrap {
    width: 106px;
    height: 72px;
    margin-bottom: 26px;
  }
  .hero-logo {
    width: 106px;
    height: 72px;
  }
  .hero-chip {
    font-size: 11px;
    margin-bottom: 22px;
  }
  .hero-title {
    font-size: clamp(22px, 6.8vw, 26px);
    line-height: 1.4;
  }
  .hero-desc {
    font-size: 14px;
    line-height: 1.95;
  }
  .progress-section { padding: 24px 10px 8px; }
  .progress-circle {
    width: 34px;
    height: 34px;
    font-size: 15px;
  }
  .progress-label { font-size: 10px; }
  .form-shell { padding: 16px 12px 64px; }
  .form-card {
    padding: 26px 18px 24px;
    border-radius: 10px;
  }
  .card-number {
    min-width: 34px;
    font-size: 26px;
  }
  .card-header h2 { font-size: 24px; }
  .card-header p { font-size: 13px; }
  input[type="text"],
  input[type="password"],
  input[type="file"],
  input[type="date"],
  select,
  textarea {
    min-height: 48px;
    font-size: 15px;
  }
  .btn,
  .btn-add,
  .record-action {
    min-height: 48px;
  }
  .site-footer { padding: 58px 16px 46px; }
  .footer-logo {
    width: 132px;
    height: 92px;
  }
  .footer-brand { font-size: 22px; }
  .admin-title { font-size: 28px; }
  .stat-number { font-size: 30px; }
  .record-name { font-size: 25px; }
  .modal-title,
  .detail-main-title {
    font-size: 25px;
    line-height: 1.28;
  }
}

@media (max-width: 420px) {
  .brand-title { font-size: 18px; }
  .hero-title { font-size: 22px; }
  .hero-desc { font-size: 13px; }
  .card-header h2 { font-size: 22px; }
}

/* Mobile hardening and final logo balance */
.footer-logo {
  width: 104px;
  height: 72px;
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #appPage,
  #adminPage,
  .site-header,
  .hero,
  .form-shell,
  .admin-shell,
  .site-footer {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .header-inner {
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
  }

  .brand,
  .brand-copy {
    min-width: 0;
  }

  .brand {
    justify-content: flex-start;
    align-items: center;
    text-align: left;
  }

  .brand-copy {
    flex: 1 1 auto;
    text-align: left;
  }

  .brand-title {
    overflow-wrap: anywhere;
    text-align: left;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .hero-title {
    max-width: 100%;
    font-size: clamp(20px, 5.9vw, 25px);
    line-height: 1.45;
  }

  .progress-section {
    padding: 18px 6px 6px;
  }

  .progress-wrap {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    align-items: start;
  }

  .progress-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
  }

  .progress-circle {
    width: 34px;
    height: 34px;
    margin: 0 auto 8px;
    font-size: 15px;
  }

  .progress-label {
    max-width: 100%;
    min-height: 2.4em;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: keep-all;
    line-height: 1.22;
    font-size: 10.5px;
  }

  .form-card,
  .record-card,
  .admin-head,
  .stat-card,
  .modal-card,
  .dynamic-item,
  .detail-block {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .form-grid,
  .record-grid,
  .detail-grid,
  .file-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .field,
  .field.full,
  .detail-grid > div,
  .record-grid > div {
    min-width: 0;
    grid-column: auto;
  }

  input[type="text"],
  input[type="password"],
  input[type="file"],
  input[type="date"],
  select,
  textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .record-top,
  .admin-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .record-actions,
  .admin-top-actions,
  .detail-status-actions,
  .detail-doc-actions,
  .detail-bottom-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .modal {
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .modal-card-sm,
  .modal-card-lg {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    margin: 12px auto;
    padding: 22px 16px 18px;
  }

  .detail-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .detail-table {
    min-width: 480px;
  }

  .file-card img {
    max-height: 260px;
  }

  .footer-logo {
    width: 72px;
    height: 52px;
  }
}

@media (max-width: 420px) {
  .header-inner {
    padding-left: 12px;
    padding-right: 12px;
  }

  .brand-mark-wrap,
  .brand-logo {
    width: 66px;
    height: 44px;
  }

  .brand-title {
    font-size: 16px;
  }

  .progress-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .progress-label {
    font-size: 10px;
  }

  .lang-btn,
  .access-btn,
  .logout-btn {
    font-size: 11px;
    padding-inline: 4px;
  }

  .hero-title {
    font-size: 20px;
  }

  .detail-table {
    min-width: 430px;
  }
}
