/* Shared portal, telemetry and task layouts. */
.dashboard-main{width:100%;max-width:1180px;margin:0 auto;padding:0 28px 36px}
.dashboard-heading{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;padding:28px 0 22px}
.dashboard-heading h1{font-family:var(--serif);font-size:34px;font-weight:500;line-height:1.3;margin:0}
.home-heading{padding:28px 0 22px}
.home-heading h1{font-size:clamp(24px,3.6vw,40px);letter-spacing:0;line-height:1.4}
.home-heading .connection-wrap{align-self:center}
.connection-wrap{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;flex-shrink:0}
.connection{display:inline-flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);white-space:nowrap}
.connection:before{content:'';width:6px;height:6px;border-radius:50%;background:var(--silver)}
.connection[data-state=live]:before{background:var(--accent)}
.connection[data-state=stale],.connection[data-state=error]{color:var(--warning)}
.connection[data-state=stale]:before,.connection[data-state=error]:before{background:var(--warning-dot)}
.retry-button{border:1px solid var(--line);background:var(--paper);color:var(--accent);border-radius:6px;font-size:14px;min-height:44px;padding:8px 12px}
.retry-button:hover{background:var(--soft)}
.entry-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 24px}
.entry-card{min-width:0;display:flex;align-items:center;justify-content:center;min-height:64px;padding:12px 16px;border:1px solid var(--line);border-radius:7px;background:var(--paper);color:var(--ink);text-decoration:none}
.entry-card:hover{background:var(--surface-hover);border-color:var(--border-hover);text-decoration:none}
.entry-card strong{display:block;font-size:18px;font-weight:550;line-height:1.5}
.section-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.section-top h2{font-size:18px;font-weight:550;margin:0}
.section-top>a{font-size:14px}
.home-status{padding-top:20px;border-top:1px solid var(--line)}
.metric-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.home-status .metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.metric{min-width:0;padding:16px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.metric h3{font-size:14px;font-weight:500;color:var(--muted);margin:0 0 8px;line-height:1.4}
.metric-value{font-size:26px;font-weight:500;line-height:1.35;letter-spacing:-.035em;font-variant-numeric:tabular-nums;margin:0;white-space:normal;overflow-wrap:normal}
.home-status .metric-value{font-size:28px}
.metric-value .metric-unit{display:inline-block;font-size:14px;letter-spacing:0;margin-left:4px;color:var(--muted)}
.metric-value.metric-unavailable{font-size:17px;color:var(--muted)}
.metric-note{font-size:14px;line-height:1.6;margin:8px 0 0;color:var(--muted)}
.metric-note:empty{display:none}
.metric-placeholder{color:var(--silver)}
.status-caption{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px 20px;margin:14px 0 0;font-size:14px;line-height:1.7;color:var(--muted)}
.status-caption a{font-size:14px}
.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:16px;margin-top:24px}
.detail-panel{min-width:0;padding:20px;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.detail-panel h2{font-size:18px;font-weight:550;line-height:1.5;margin:0 0 12px}
.detail-list{margin:0}
.detail-list>div{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding:9px 0;border-top:1px solid var(--line-subtle)}
.detail-list>div:first-child{border-top:0;padding-top:0}
.detail-list dt{flex-shrink:0;max-width:42%;font-size:15px;color:var(--muted)}
.detail-list dd{flex:1;min-width:0;margin:0;font-size:16px;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.detail-list[data-fan-details]>div:first-child{border-top:1px solid var(--line-subtle);padding-top:12px}
.service-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-top:1px solid var(--line-subtle)}
.service-row:first-child{padding-top:0;border-top:0}
.service-row a{font-size:16px}
.service-state{font-size:14px;color:var(--muted);white-space:nowrap}
.service-state[data-state=error]{color:var(--warning)}
.detail-note,.page-note{font-size:14px;color:var(--muted);line-height:1.8;margin:16px 0 0}
.detail-note:empty{display:none}
.reading-notes{padding:12px 0;border-top:1px solid var(--line);margin-top:20px;color:var(--muted);font-size:14px}
.reading-notes summary{min-height:44px;padding:10px 0;font-size:14px;cursor:pointer;width:max-content}
.reading-notes p{margin:14px 0 0;max-width:850px}
.task-summary-bar{display:flex;align-items:center;gap:18px;padding:0 0 22px}
.task-summary-bar>div{display:flex;align-items:baseline;gap:14px}
.task-summary-bar .detail-label{font-size:16px;color:var(--muted)}
.task-summary-bar strong{font-size:32px;font-weight:500;font-variant-numeric:tabular-nums}
.tasks-panel{overflow:hidden;border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.task-table-wrap{width:100%;overflow:auto}
.task-table{width:100%;border-collapse:collapse;font-size:15px;text-align:left}
.task-table th{padding:16px 22px;background:var(--table-head);font-size:14px;color:var(--muted);font-weight:500;white-space:nowrap}
.task-table td{padding:20px 22px;border-top:1px solid var(--line);vertical-align:top;font-variant-numeric:tabular-nums}
.task-table th:first-child,.task-table td:first-child{width:40%}
.task-name{display:block;font-size:16px;font-weight:500}
.task-project{display:block;font-size:14px;color:var(--muted);margin-top:6px}
.task-state{color:var(--accent);white-space:nowrap}
.task-empty{padding:28px 16px!important;text-align:center;color:var(--muted);font-size:16px}
.task-resource{white-space:nowrap}
@media(min-width:761px) and (max-width:1050px){[data-page=machine] .metric-grid{grid-template-columns:repeat(6,minmax(0,1fr))}[data-page=machine] .metric{grid-column:span 2}[data-page=machine] .metric:nth-child(n+4){grid-column:span 3}}
.task-field-label{display:none}
@media(max-width:760px){
  .dashboard-main{padding:0 16px 28px}
  .dashboard-heading{padding:22px 0 18px;gap:10px 16px}
  .dashboard-heading h1{font-size:28px}
  .home-heading h1{font-size:clamp(24px,5.8vw,32px)}
  .home-heading .connection-wrap{margin-left:auto}
  .entry-grid{gap:8px;margin-bottom:20px}
  .entry-card{min-height:52px;padding:10px 8px}
  .entry-card strong{font-size:16px;font-weight:500;white-space:nowrap}
  .home-status{padding-top:16px}
  .metric-grid,.home-status .metric-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .metric:nth-child(2){grid-column:1/-1;grid-row:2}
  .metric{padding:14px}
  .metric-value,.home-status .metric-value,.metric:nth-child(2) .metric-value{font-size:26px}
  .metric-value.metric-unavailable{font-size:17px}
  .detail-grid{grid-template-columns:1fr;gap:12px;margin-top:20px}
  .detail-panel{padding:16px}
  .detail-list>div{gap:12px;padding:9px 0}
  .status-caption{gap:4px 16px}
  .task-summary-bar{padding-bottom:14px}
  .task-summary-bar strong{font-size:26px}
  .task-table,.task-table tbody{display:block;width:100%}
  .task-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .task-table tbody tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 8px;padding:16px;border-top:1px solid var(--line)}
  .task-table tbody tr:first-child{border-top:0}
  .task-table td{display:block;min-width:0;border:0;padding:0;font-size:14px;overflow-wrap:anywhere}
  .task-table td:first-child{grid-column:1/3;width:auto}
  .task-table .task-state{justify-self:end;white-space:normal}
  .task-name{font-size:16px;line-height:1.5}
  .task-project:empty{display:none}
  .task-resource{white-space:normal}
  .task-field-label{display:block;margin-bottom:3px;color:var(--muted);font-size:13px}
  .task-table td.task-empty{grid-column:1/-1;width:100%;padding:12px 0!important}
}
@media(prefers-reduced-motion:no-preference){.entry-card,.retry-button{transition:background .15s,border-color .15s}}

.metric .metric-value.metric-unavailable{font-size:17px}

/* Homepage: compose and notes, then review beside machine status. */
.home-section{min-width:0;padding-top:20px;margin-top:24px;border-top:1px solid var(--line)}
.entry-grid + .home-section{margin-top:0;padding-top:0;border-top:0}
.home-notes-grid,.home-study-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:24px}
.home-notes-grid{align-items:stretch}
.home-note-compose-column{display:flex;flex-direction:column;gap:10px;min-width:0}
.home-notes .notes-compose{display:flex;flex:1;margin:0;padding:14px 16px}
.home-notes #note-form{display:flex;flex-direction:column;flex:1;min-width:0}
.home-notes #note-input{flex:1;min-height:128px}
.home-notes .note-error{margin:0}
.home-notes-actions{display:flex;align-items:center;gap:16px;font-size:14px}
.home-notes button:disabled{cursor:wait;opacity:.6}
.home-notes-panel,.home-task-list,.home-machine-panel{border:1px solid var(--line);border-radius:7px;background:var(--paper)}
.home-notes-panel{min-width:0;padding:0 16px}
.home-note-list,.home-task-list{list-style:none;padding:0;margin:0}
.home-note-list li{display:grid;grid-template-columns:44px minmax(0,1fr);gap:4px;align-items:start;border-top:1px solid var(--line)}
.home-note-list li:first-child{border-top:0}
.home-note-list a{display:flex;align-items:center;min-height:44px;min-width:0;padding:9px 0;color:var(--ink);font-size:15px;line-height:1.6}
.home-note-list span{white-space:pre-wrap;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.home-notes .note-empty h3{margin:0;font-size:16px;font-weight:400;color:var(--muted)}
.home-study-grid{align-items:stretch;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.home-study-grid>.home-section{display:flex;flex-direction:column;padding:0;margin:0;border:0}
.home-study-grid>.home-section>.section-top{min-height:44px;flex-shrink:0}
.home-review-actions,.home-status-tools{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px 14px;font-size:14px}
.home-review .draw-toolbar{display:none}
.home-review #home-view,.home-review #home-card{display:flex;flex-direction:column;flex:1;min-width:0}
.home-review .knowledge-card{display:flex;flex-direction:column;flex:1;width:100%;max-width:none;padding:16px}
.home-review .card-title{font-size:30px}
.home-review .meaning{font-size:17px;line-height:1.7;margin-bottom:12px}
.home-review .card-meta{margin-bottom:12px}
.home-review .card-block{padding-top:12px;margin-top:12px}
.home-review .home-card-detail{display:inline-flex;align-items:center;align-self:flex-start;min-height:44px;margin-top:auto;padding-top:8px;font-size:14px}
.home-review .section-top{gap:8px;flex-wrap:wrap}
.home-review-actions .primary{min-height:44px;padding:8px 14px;font-size:15px}
.home-status .section-top{gap:8px;flex-wrap:wrap}
.home-machine-panel{display:flex;flex-direction:column;flex:1;padding:16px}
.home-status .metric-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;border-bottom:1px solid var(--line);padding-bottom:12px}
.home-status .metric{padding:0;border:0;border-radius:0;background:transparent;grid-column:auto;grid-row:auto}
.home-status .metric h3{margin-bottom:5px}
.home-status .metric .metric-value{font-size:22px;line-height:1.5;letter-spacing:-.035em}
.home-status .metric .metric-value.metric-unavailable{font-size:16px}
.home-status .metric-unit{font-size:13px;margin-left:2px}
.home-machine-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;margin:4px 0 0}
.home-machine-facts>div,.home-fan-list>div{display:flex;justify-content:space-between;align-items:baseline;gap:4px 10px;flex-wrap:wrap;padding:8px 0;border-bottom:1px solid var(--line)}
.home-machine-facts dt,.home-fan-list dt{font-size:14px;color:var(--muted)}
.home-machine-facts dd,.home-fan-list dd{font-size:15px;margin:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.home-fan-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px;margin:0}
.home-services{margin-top:4px}
.home-services .service-row{padding:7px 0}
.home-services .service-row:first-child{padding-top:7px}
.home-services .service-row a{font-size:15px}
.home-status .status-caption{margin-top:auto;padding-top:8px}
.home-message{font-size:15px;color:var(--muted);line-height:1.8;margin:0}
.home-task-list{margin-top:12px;padding:0 20px}
.home-task-list li{display:flex;justify-content:space-between;gap:12px 24px;align-items:center;padding:15px 0;border-top:1px solid var(--line)}
.home-task-list li:first-child{border-top:0}
.home-task-list li>div:first-child{min-width:0;overflow-wrap:anywhere}
.home-task-list .task-project{margin-top:2px;overflow-wrap:anywhere}
.home-task-info{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:4px 18px;font-size:14px;color:var(--muted);flex-shrink:0}
@media(max-width:900px){.home-notes-grid,.home-study-grid{grid-template-columns:minmax(0,1fr)}.home-notes-grid{row-gap:12px}.home-study-grid{row-gap:24px}}
@media(max-width:700px){.home-notes #note-input{min-height:80px}}
@media(max-width:760px){
  .home-task-list{padding:0 16px}
  .home-task-list li{align-items:flex-start}
  .home-task-info{max-width:40%;flex-direction:column;align-items:flex-end;text-align:right}
  .home-review .knowledge-card,.home-machine-panel{padding:16px}
  .home-study-grid{margin-top:20px;padding-top:20px}
}

@media(max-width:480px){.home-machine-facts>div,.home-fan-list>div{flex-direction:column;align-items:flex-start;flex-wrap:nowrap;gap:2px}}
