:root {
  color-scheme: light;
  --ink: #173247;
  --muted: #637887;
  --line: #d9e4eb;
  --surface: #fff;
  --canvas: #eff5f8;
  --brand: #08749c;
  --brand-dark: #075b7d;
  --mint: #e8f5f2;
  --shadow: 0 16px 44px rgba(23, 50, 71, .09);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  padding: 28px 18px 48px;
  color: var(--ink);
  background: radial-gradient(ellipse at 8% 0%, #dceff4 0, transparent 38%), linear-gradient(145deg, #f4f8fa, #edf4f6 65%, #f7f8f4);
  font: 15px/1.55 "Plus Jakarta Sans", Inter, "Segoe UI", Arial, sans-serif;
}
.tool-page { width: min(100%, 1040px); margin: 0 auto; }
.tool-nav { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 15px; }
.tool-nav a, .portal-nav a { display:inline-flex; align-items:center; min-height:36px; padding:7px 12px; border:1px solid #d5e2e9; border-radius:9px; background:rgba(255,255,255,.86); color:#34566a; text-decoration:none; font-size:12px; font-weight:700; transition:.18s ease; }
.tool-nav a:hover, .portal-nav a:hover { border-color:#8ebbc7; background:#fff; color:var(--brand-dark); transform:translateY(-1px); }
.tool-header { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-bottom:17px; padding:23px 26px; border:1px solid #14566e; border-radius:17px; color:#fff; background:linear-gradient(115deg,#173b4d,#08749c); box-shadow:var(--shadow); }
.tool-header h1 { margin:0; font-size:clamp(22px,3vw,30px); line-height:1.2; letter-spacing:-.025em; }
.tool-header .eyebrow { margin:0 0 6px; color:#b9e0e9; font-size:10px; font-weight:800; letter-spacing:.13em; }
.tool-header .subheading { margin:7px 0 0; color:#d7e9ed; font-size:13px; }
.status-chip { display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; padding:6px 10px; border:1px solid #cfe8df; border-radius:999px; color:#176247; background:#e8f7ef; font-size:11px; font-weight:800; white-space:nowrap; }
.status-chip.locked, .status-chip.cancelled { border-color:#f2d4d2; color:#a63d3b; background:#fff0ee; }
.status-chip.active, .status-chip.open { border-color:#d3e8f4; color:#17618a; background:#eaf5fb; }
.status-chip.completed { border-color:#c9e6d5; color:#246b49; background:#eaf7ef; }
.info-card, .tool-card, .portal-card { border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:var(--shadow); }
.info-card { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-bottom:15px; padding:6px 18px; }
.info-card > div { min-width:0; padding:12px 10px; border-bottom:1px solid #edf1f4; }
.info-card > div.wide { grid-column:1/-1; border-bottom:0; }
.info-card span, .portal-fact span { display:block; margin-bottom:3px; color:var(--muted); font-size:10px; font-weight:800; letter-spacing:.055em; text-transform:uppercase; }
.info-card strong { display:block; overflow-wrap:anywhere; font-size:13px; font-weight:700; }
.tool-card { margin:15px 0; padding:20px 22px; }
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:15px; }
.section-heading h2 { margin:0; color:#193d52; font-size:17px; letter-spacing:-.015em; }
.section-heading p { margin:3px 0 0; color:var(--muted); font-size:12px; }
.notice { margin:14px 0; padding:11px 14px; border:1px solid #cbe6d7; border-radius:10px; color:#216346; background:#eff9f3; font-size:13px; font-weight:650; }
.notice.error { border-color:#f0cdca; color:#a33b37; background:#fff4f2; }
.notice.info { border-color:#cfe3ef; color:#245b76; background:#f0f8fc; }
.upload-form { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:10px 12px; }
.upload-form label, .upload-form input[type=file], .upload-hint, .selected-previews { grid-column:1/-1; }
.upload-hint { color:var(--muted); font-size:11px; }
.upload-form .primary-button { grid-column:2; justify-self:end; }
.selected-previews { display:flex; flex-wrap:wrap; gap:8px; }
.selected-preview-item { display:flex; align-items:center; gap:7px; max-width:220px; padding:5px 8px; border:1px solid #dce7ed; border-radius:8px; background:#f8fbfc; color:#526977; font-size:10px; }
.selected-preview-item img { width:38px; height:38px; border-radius:5px; object-fit:cover; }
.selected-preview-item > span:last-child { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.upload-form label, .plan-form label { color:#37566a; font-size:12px; font-weight:750; }
.upload-form input[type=file] { width:100%; min-width:0; padding:9px; border:1px solid #d6e1e8; border-radius:9px; background:#f9fbfc; color:#526977; font:inherit; font-size:12px; }
.primary-button, .secondary-button { display:inline-flex; align-items:center; justify-content:center; min-height:40px; padding:8px 14px; border:0; border-radius:9px; color:#fff; background:var(--brand); font:inherit; font-size:12px; font-weight:700; cursor:pointer; transition:.18s ease; }
.primary-button:hover, .secondary-button:hover { background:var(--brand-dark); box-shadow:0 6px 14px #08749c2c; transform:translateY(-1px); }
.secondary-button { min-height:35px; color:#24556c; border:1px solid #cfe1e9; background:#f4fafc; }
.secondary-button:hover { color:#164b63; border-color:#a6ceda; background:#e8f5f8; }
.file-list, .plan-list { display:grid; gap:9px; }
.file-item { display:flex; align-items:center; gap:13px; min-width:0; padding:12px 13px; border:1px solid #e2eaf0; border-radius:11px; background:#fcfdfe; }
.file-type { display:grid; place-items:center; width:42px; height:42px; flex:0 0 auto; border-radius:10px; color:#096e8f; background:#e6f4f8; font-size:10px; font-weight:850; }
.file-preview { width:64px; height:52px; flex:0 0 auto; border:1px solid #dce7ed; border-radius:8px; background:#f2f6f8; object-fit:cover; }
.image-gallery { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px; }
.image-card { min-width:0; overflow:hidden; border:1px solid #dce7ed; border-radius:12px; background:#fff; }
.image-open { display:grid; place-items:center; width:100%; min-height:190px; padding:8px; border:0; background:#f3f7f9; cursor:zoom-in; }
.file-full-image { display:block; width:100%; height:230px; object-fit:contain; }
.image-caption { display:grid; gap:3px; padding:10px 12px; }
.image-caption strong { overflow:hidden; color:#24556c; font-size:11px; text-overflow:ellipsis; white-space:nowrap; }
.image-caption span { color:var(--muted); font-size:10px; }
.image-viewer { width:min(96vw,1200px); max-width:96vw; max-height:94vh; padding:12px; border:1px solid #d5e1e8; border-radius:14px; background:#101820; color:#fff; box-shadow:0 24px 70px #0008; }
.image-viewer::backdrop { background:#07131dbb; }
.image-viewer-head { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:2px 2px 10px; font-size:12px; }
.viewer-close { min-height:32px; padding:5px 11px; border:1px solid #59707e; border-radius:7px; color:#fff; background:#263b48; cursor:pointer; }
.image-viewer > img { display:block; max-width:100%; max-height:calc(94vh - 70px); margin:0 auto; object-fit:contain; }
.file-main { display:grid; min-width:0; flex:1; gap:2px; }
.file-main a { overflow-wrap:anywhere; color:#075f85; font-size:13px; font-weight:750; text-decoration:none; }
.file-main a:hover { text-decoration:underline; }
.file-main span { color:var(--muted); font-size:11px; }
.download-link { color:#31576a; font-size:11px; font-weight:750; text-decoration:none; white-space:nowrap; }
.empty-state { display:grid; place-items:center; gap:4px; min-height:112px; padding:20px; border:1px dashed #cfdae2; border-radius:11px; color:var(--muted); background:#fafcfd; text-align:center; }
.empty-state strong { color:#385a6d; font-size:13px; }
.empty-state span { font-size:12px; }
.plan-form { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(150px,.6fr); gap:12px 15px; }
.plan-form label { display:grid; gap:5px; }
.plan-form .full, .plan-form .form-actions { grid-column:1/-1; }
.plan-form input, .plan-form textarea, .portal-form input { width:100%; min-height:41px; padding:9px 11px; border:1px solid #cfdae3; border-radius:9px; outline:none; color:var(--ink); background:#fff; font:inherit; font-size:13px; }
.plan-form textarea { min-height:80px; resize:vertical; }
.plan-form input:focus, .plan-form textarea:focus, .portal-form input:focus { border-color:#60a8bd; box-shadow:0 0 0 3px #08749c1a; }
.plan-form .form-actions { display:flex; justify-content:flex-end; }
.plan-item { padding:16px 17px; border:1px solid #dfe8ed; border-radius:12px; background:linear-gradient(135deg,#fff,#fbfdfe); }
.plan-top, .progress-copy { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.plan-top h3 { margin:0; color:#193f54; font-size:15px; }
.plan-date { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.progress-copy { align-items:center; margin:14px 0 7px; color:#3a586a; font-size:11px; }
.progress-copy strong { font-size:12px; }
.progress-track { height:8px; overflow:hidden; border-radius:99px; background:#e7eef2; }
.progress-track span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,#0c9b85,#27b08e); }
.plan-notes { margin:12px 0 0; padding:10px 12px; border-left:3px solid #8fc5d3; border-radius:0 8px 8px 0; color:#496373; background:#f2f8fa; font-size:12px; white-space:normal; }
.session-form { display:flex; justify-content:flex-end; margin-top:12px; }
.portal-page { width:min(100%,900px); margin:0 auto; }
.portal-topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.portal-brand { margin:0 0 18px; color:#27536a; font-size:11px; font-weight:850; letter-spacing:.12em; text-align:center; }
.portal-topbar .portal-brand { margin:0; text-align:left; }
.portal-login-link { display:inline-flex; align-items:center; justify-content:center; min-height:34px; padding:7px 12px; border:1px solid #cfe1e9; border-radius:9px; color:#24556c; background:#fff; font-size:11px; font-weight:750; text-decoration:none; white-space:nowrap; }
.portal-login-link:hover { border-color:#8fc5d3; color:#076d91; background:#f4fafc; }
.portal-card { margin:14px 0; padding:22px 24px; }
.portal-result { padding:0; overflow:hidden; }
.portal-result-summary { display:flex; align-items:center; justify-content:space-between; gap:14px; min-height:64px; padding:16px 20px; color:#1d4358; cursor:pointer; list-style:none; }
.portal-result-summary::-webkit-details-marker { display:none; }
.portal-result-summary::after { content:'+'; display:grid; place-items:center; width:27px; height:27px; flex:0 0 auto; border:1px solid #cfe1e9; border-radius:50%; color:#08749c; font-size:19px; line-height:1; }
.portal-result[open] .portal-result-summary::after { content:'−'; }
.portal-result-summary strong { font-size:16px; }
.portal-result-summary strong span { color:#08749c; }
.portal-result-meta { margin-left:auto; color:var(--muted); font-size:12px; text-align:right; }
.portal-result-body { padding:0 20px 20px; border-top:1px solid #e5edf1; }
.portal-card h1 { margin:0; color:#076d91; font-size:24px; letter-spacing:-.03em; }
.portal-card h2 { margin:0 0 13px; color:#1d4358; font-size:17px; }
.portal-intro { margin:7px 0 18px; color:var(--muted); font-size:13px; }
.portal-form { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(140px,.8fr) minmax(0,1fr) auto; align-items:end; gap:12px; }
.portal-form label { display:grid; gap:5px; color:#36576b; font-size:11px; font-weight:750; }
.portal-form button { min-width:120px; }
.portal-facts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 18px; }
.portal-fact { min-width:0; padding:11px 12px; border:1px solid #e1eaf0; border-radius:10px; background:#f8fbfc; }
.portal-fact strong { display:block; overflow-wrap:anywhere; font-size:13px; }
.portal-section { margin-top:17px; }
.portal-section h3 { margin:0 0 9px; color:#24536a; font-size:13px; }
.portal-section p { margin:6px 0; color:#354f60; font-size:13px; }
.portal-table-wrap { overflow-x:auto; border:1px solid #e1e9ee; border-radius:10px; }
.portal-table { width:100%; border-collapse:collapse; font-size:12px; }
.portal-table th, .portal-table td { padding:10px 11px; border-bottom:1px solid #e7edf1; text-align:left; vertical-align:top; }
.portal-table th { color:#3b6074; background:#f0f7fa; font-size:10px; letter-spacing:.04em; text-transform:uppercase; }
.portal-table tr:last-child td { border-bottom:0; }
.money-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.money-item { padding:11px; border:1px solid #dfe9ee; border-radius:10px; background:#f9fbfc; }
.money-item span { display:block; color:var(--muted); font-size:10px; font-weight:750; }
.money-item strong { display:block; margin-top:4px; color:#1d4b60; font-size:15px; }
.money-item.due strong { color:#b64542; }
.portal-error { margin:14px 0 0; padding:10px 12px; border:1px solid #efcfca; border-radius:9px; color:#9d3935; background:#fff3f1; font-size:12px; font-weight:650; }
@media (max-width:760px) {
  body { padding:17px 10px 32px; }
  .tool-header { align-items:flex-start; padding:18px; }
  .info-card { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .info-card > div.wide { grid-column:1/-1; border:0; }
  .portal-form { grid-template-columns:1fr 1fr; }
  .portal-form button { grid-column:1/-1; }
  .money-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:520px) {
  .tool-header { display:grid; gap:12px; }
  .info-card { padding:4px 9px; }
  .info-card > div { padding:10px 7px; }
  .tool-card, .portal-card { padding:16px 14px; }
  .upload-form, .plan-form, .portal-form, .portal-facts { grid-template-columns:1fr; }
  .upload-form .primary-button, .plan-form .full, .plan-form .form-actions, .portal-form button { grid-column:1; }
  .image-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
  .image-open { min-height:130px; }
  .file-full-image { height:160px; }
  .upload-form label { margin-bottom:-7px; }
  .file-item { align-items:flex-start; gap:9px; }
  .download-link { align-self:center; }
  .portal-card h1 { font-size:21px; }
  .portal-result-summary { align-items:flex-start; flex-wrap:wrap; padding:14px; }
  .portal-result-summary strong { flex:1 1 calc(100% - 44px); }
  .portal-result-meta { order:3; width:calc(100% - 44px); margin:0; text-align:left; }
  .portal-result-body { padding:0 14px 14px; }
  .money-grid { grid-template-columns:1fr 1fr; }
}
