:root {
    --bg: #090b0d;
    --panel: #14171a;
    --ink: #f5f1e9;
    --muted: #aaa49a;
    --line: #34302a;

    --gold: #e6b061;
    --dark: #090b0d;
    --blue: #c8954c;

    --normal: #39a873;
    --watch: #d59b35;
    --warning: #df7138;
    --critical: #dc4b49;
    --unknown: #8b8781;
}

*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Tahoma,Arial,sans-serif}
button,input,select{font:inherit}

.water-header{min-height:70px;background:var(--dark);color:#fff;display:flex;align-items:center;justify-content:space-between;padding:9px 26px;box-shadow:0 2px 12px #0004}
.brand{display:flex;align-items:center;gap:12px;color:#fff;text-decoration:none}.brand img{width:52px;height:52px;object-fit:contain}.brand strong{display:block;font-size:18px}.brand span{display:block;color:#dfc28e;font-size:12px;margin-top:2px}
.water-header nav{display:flex;align-items:center;gap:17px}.water-header nav a{color:#fff;text-decoration:none;font-size:13px}.water-header nav a:hover{color:#f0c879}

.water-page{max-width:1500px;margin:auto;padding:16px}
.hero-card{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:21px 23px;background:linear-gradient(120deg,#fff 0%,#f9f5ee 64%,#e5eef0 100%);border:1px solid var(--line);border-radius:17px;box-shadow:0 5px 22px #46351e12}
.eyebrow{display:block;color:var(--gold);font-size:11px;font-weight:800;letter-spacing:.08em;margin-bottom:7px}.hero-card h1{font-size:27px;margin:0 0 7px}.hero-card p{margin:0;color:var(--muted);font-size:13px;line-height:1.7;max-width:780px}
.hero-update{min-width:205px;text-align:right}.hero-update span{display:block;color:var(--muted);font-size:11px}.hero-update strong{display:block;font-size:14px;margin:5px 0 9px}.hero-update button{border:0;border-radius:9px;padding:8px 12px;background:var(--dark);color:#fff;cursor:pointer;font-size:12px}

.summary-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:12px 0}.summary-card{position:relative;overflow:hidden;background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px 15px;min-height:99px}.summary-card::before{content:"";position:absolute;inset:0 auto 0 0;width:5px;background:var(--blue)}.summary-card span{display:block;color:var(--muted);font-size:12px}.summary-card strong{display:inline-block;font-size:31px;margin:8px 6px 0 0}.summary-card small{color:var(--muted)}.summary-card.normal::before{background:var(--normal)}.summary-card.watch::before{background:var(--watch)}.summary-card.warning::before{background:var(--warning)}.summary-card.critical::before{background:var(--critical)}
.summary-card.normal strong{color:var(--normal)}.summary-card.watch strong{color:var(--watch)}.summary-card.warning strong{color:var(--warning)}.summary-card.critical strong{color:var(--critical)}

.situation-notice{display:flex;gap:12px;align-items:center;background:#e8f2ed;border:1px solid #c9dfd2;border-radius:13px;padding:12px 15px;margin-bottom:11px}.situation-notice.warning{background:#fff1e7;border-color:#eac9b3}.situation-notice.critical{background:#fbe9e8;border-color:#e3b8b5}.situation-notice.stale{background:#f4eee3;border-color:#ddd0bc}.notice-icon{font-size:27px}.situation-notice strong{font-size:13px}.situation-notice p{margin:3px 0 0;color:var(--muted);font-size:12px}

.filter-bar{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto;gap:8px;background:var(--panel);border:1px solid var(--line);border-radius:13px;padding:10px;margin-bottom:10px}.filter-bar input,.filter-bar select,.filter-bar button{width:100%;min-height:42px;border:1px solid var(--line);border-radius:9px;background:#fff;padding:9px 11px;color:var(--ink)}.filter-bar button{background:var(--dark);color:#fff;font-weight:700;cursor:pointer}

.workspace{display:grid;grid-template-columns:365px minmax(0,1fr);gap:10px;min-height:670px}.station-panel,.detail-panel{background:var(--panel);border:1px solid var(--line);border-radius:15px;overflow:hidden}.station-panel{display:flex;flex-direction:column}.panel-head{display:flex;justify-content:space-between;gap:12px;padding:13px 14px;border-bottom:1px solid var(--line)}.panel-head span{font-size:12px;color:var(--muted)}.station-list{padding:8px;overflow:auto;max-height:710px}.state-box{padding:30px 18px;text-align:center;color:var(--muted);font-size:13px}
.station-item{display:block;width:100%;text-align:left;border:1px solid var(--line);background:#fff;border-radius:12px;padding:11px;margin-bottom:8px;cursor:pointer;color:var(--ink);transition:.16s}.station-item:hover,.station-item.active{border-color:var(--gold);box-shadow:0 0 0 2px #b77a201d}.station-item-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}.station-code{display:inline-block;background:#e8f1f4;color:#285c6e;border-radius:7px;padding:4px 7px;font-weight:800;font-size:11px}.station-level{text-align:right}.station-level strong{display:block;font-size:19px}.station-level span{font-size:10px;color:var(--muted)}.station-name{font-weight:700;font-size:13px;margin-top:8px}.station-location{font-size:11px;color:var(--muted);margin-top:4px;line-height:1.5}.station-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px;font-size:11px}.station-time{color:var(--muted)}

.severity-pill{display:inline-flex;align-items:center;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:800;background:#edf0f1;color:#557080;white-space:nowrap}.severity-pill.info{background:#e5f2eb;color:var(--normal)}.severity-pill.watch{background:#fff1d9;color:var(--watch)}.severity-pill.warning{background:#ffeadf;color:var(--warning)}.severity-pill.critical{background:#f9e1df;color:var(--critical)}.severity-pill.unknown{background:#eeeae5;color:var(--unknown)}

.detail-panel{padding:18px;min-width:0}.detail-empty{height:100%;min-height:570px;display:grid;place-content:center;text-align:center;color:var(--muted);gap:7px}.detail-empty[hidden]{display:none!important}#detailContent[hidden]{display:none!important}#detailContent.is-visible{display:block!important}.detail-empty div{font-size:54px}.detail-empty strong{color:var(--ink)}.detail-empty span{font-size:12px}.detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;border-bottom:1px solid var(--line);padding-bottom:14px}.detail-code{color:var(--blue);font-size:12px;font-weight:800}.detail-head h2{font-size:22px;margin:4px 0}.detail-head p{color:var(--muted);font-size:12px;margin:0}
.reading-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin:13px 0}.reading-grid>div{border:1px solid var(--line);background:#faf8f4;border-radius:12px;padding:12px}.reading-grid span{display:block;font-size:11px;color:var(--muted)}.reading-grid strong{display:inline-block;font-size:23px;margin:7px 5px 0 0}.reading-grid small{color:var(--muted);font-size:10px}

.chart-card{position:relative;border:1px solid var(--line);border-radius:13px;padding:13px}.chart-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}.chart-head strong{display:block;font-size:13px}.chart-head span{display:block;font-size:10px;color:var(--muted);margin-top:3px}.chart-head select{border:1px solid var(--line);border-radius:8px;padding:7px;background:#fff}.chart-wrap{position:relative;height:330px}.chart-loading{position:absolute;inset:55px 10px 10px;background:#fffd;display:grid;place-items:center;color:var(--muted);font-size:13px}.chart-loading[hidden]{display:none}
.detail-meta{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;margin-top:12px}.meta-row{background:#f6f2ec;border-radius:9px;padding:9px 10px;font-size:12px}.meta-row span{display:block;color:var(--muted);font-size:10px;margin-bottom:3px}.detail-actions{display:flex;gap:8px;margin-top:12px}.detail-actions a{flex:1;text-align:center;text-decoration:none;background:var(--dark);color:#fff;border-radius:9px;padding:10px;font-size:12px;font-weight:700}.detail-actions a:last-child{background:var(--gold)}.detail-actions a[hidden]{display:none}

.source-note{display:flex;flex-wrap:wrap;gap:5px 9px;margin-top:10px;padding:12px 14px;background:#e8e2d9;border-radius:11px;color:var(--muted);font-size:11px}.source-note strong{color:var(--ink)}.source-note span{width:100%}.global-loading{position:fixed;left:50%;top:84px;transform:translateX(-50%);z-index:1000;background:var(--dark);color:#fff;border-radius:999px;padding:9px 14px;font-size:12px}.global-loading[hidden]{display:none}

@media(max-width:1050px){.summary-grid{grid-template-columns:repeat(3,1fr)}.reading-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:850px){.water-header{padding:8px 12px}.water-header nav{display:none}.water-page{padding:9px}.hero-card{align-items:flex-start}.summary-grid{grid-template-columns:repeat(2,1fr)}.filter-bar{grid-template-columns:1fr 1fr}.filter-bar input{grid-column:1/-1}.workspace{grid-template-columns:1fr}.station-panel{order:2}.station-list{max-height:500px}.detail-empty{min-height:350px}.chart-wrap{height:280px}}
@media(max-width:520px){.brand strong{font-size:15px}.brand img{width:44px;height:44px}.hero-card{display:block;padding:16px}.hero-card h1{font-size:21px}.hero-update{text-align:left;margin-top:13px}.summary-grid{gap:7px}.summary-card{padding:12px;min-height:90px}.filter-bar{grid-template-columns:1fr}.filter-bar input{grid-column:auto}.detail-panel{padding:12px}.reading-grid{grid-template-columns:1fr 1fr}.reading-grid strong{font-size:19px}.detail-meta{grid-template-columns:1fr}.chart-wrap{height:250px}}
/* =========================================================
   CM77 LANNA BROWN THEME — FINAL
   ========================================================= */

:root {
    --bg: #b88950;
    --panel: #5a290d;
    --ink: #fff4df;
    --muted: #d9bd96;
    --line: #8a5727;

    --gold: #d6a52e;
    --dark: #472008;
    --blue: #d6a52e;

    --normal: #42ad72;
    --watch: #d6a52e;
    --warning: #e47738;
    --critical: #db4848;
    --unknown: #aaa097;
}

body {
    background: #b88950;
    color: var(--ink);
}

/* แถบด้านบน */
.water-header {
    background: linear-gradient(90deg, #3e1a07, #642d0d);
    border-bottom: 2px solid #d6a52e;
    box-shadow: 0 3px 14px rgba(48,20,4,.28);
}

.brand span {
    color: #d9bd96;
}

.water-header nav a {
    color: #fff4df;
}

.water-header nav a:hover {
    color: #f2c75d;
}

/* กล่องหัวเรื่อง */
.hero-card {
    background: linear-gradient(135deg, #512207, #71350f);
    border-color: #95602c;
    color: #fff4df;
    box-shadow: 0 5px 18px rgba(56,25,5,.25);
}

.hero-card h1 {
    color: #fff4df;
}

.hero-card p,
.hero-update span {
    color: #d9bd96;
}

.hero-update strong {
    color: #fff4df;
}

.eyebrow {
    color: #e2b854;
}

/* การ์ดสรุป */
.summary-card {
    background: linear-gradient(145deg, #59270b, #6a310e);
    border-color: #8a5727;
    color: #fff4df;
    box-shadow: 0 4px 13px rgba(58,25,5,.20);
}

.summary-card span,
.summary-card small {
    color: #d9bd96;
}

.summary-card.total strong {
    color: #f2c75d;
}

/* แถบแจ้งสถานการณ์ */
.situation-notice,
.situation-notice.stale {
    background: #3d210d;
    border-color: #805020;
    color: #fff4df;
}

.situation-notice p {
    color: #d9bd96;
}

.situation-notice.warning {
    background: #4b2b0c;
    border-color: #ad7529;
}

.situation-notice.critical {
    background: #481a16;
    border-color: #a9453d;
}

/* ตัวกรอง */
.filter-bar {
    background: #754017;
    border-color: #98632d;
}

.filter-bar input,
.filter-bar select,
.chart-head select {
    background: #fff8ea;
    border-color: #a8763c;
    color: #3d210d;
}

.filter-bar input::placeholder {
    color: #88735d;
}

/* ปุ่ม */
.hero-update button,
.filter-bar button,
.detail-actions a,
.global-loading {
    background: #d6a52e;
    border: 1px solid #ecc968;
    color: #351a08;
}

.hero-update button:hover,
.filter-bar button:hover,
.detail-actions a:hover {
    background: #f0c65b;
}

/* พื้นที่รายการและรายละเอียด */
.station-panel,
.detail-panel,
.chart-card {
    background: #57260a;
    border-color: #895727;
    color: #fff4df;
    box-shadow: 0 5px 17px rgba(55,24,5,.22);
}

.panel-head {
    background: #672f0d;
    border-bottom-color: #8a5727;
    color: #fff4df;
}

.panel-head span {
    color: #d9bd96;
}

/* รายการสถานี */
.station-item {
    background: #6a310e;
    border-color: #8a5727;
    color: #fff4df;
}

.station-item:hover,
.station-item.active {
    background: #7b4117;
    border-color: #d6a52e;
    box-shadow: 0 0 0 2px rgba(214,165,46,.20);
}

.station-code {
    background: #d6a52e;
    color: #351a08;
}

.station-location,
.station-time,
.station-level span {
    color: #d9bd96;
}

/* รายละเอียดสถานี */
.detail-head {
    border-bottom-color: #8a5727;
}

.detail-head h2,
.detail-empty strong {
    color: #fff4df;
}

.detail-code {
    color: #e2b854;
}

.detail-head p,
.detail-empty,
.detail-empty span {
    color: #d9bd96;
}

/* ช่องค่าระดับน้ำ */
.reading-grid > div,
.meta-row {
    background: #713711;
    border-color: #94602b;
    color: #fff4df;
}

.reading-grid span,
.reading-grid small,
.meta-row span,
.chart-head span {
    color: #d9bd96;
}

/* หมายเหตุด้านล่าง */
.source-note {
    background: #472008;
    border: 1px solid #805020;
    color: #d9bd96;
}

.source-note strong {
    color: #e2b854;
}

.source-note span {
    color: #d9bd96;
}