/* Training Center 2.1. Scoped to avoid changing the station or E-Logbook. */
.tc {
  --tc-panel: #102b3a;
  --tc-panel-raised: #173746;
  --tc-border: #335666;
  --tc-muted: #b2c8d4;
  --tc-teal: #68d1c3;
  --tc-amber: #f4bc72;
  --tc-red: #ffaaaa;
  color: #ecf4f7;
  min-width: 0;
}
.tc *, .tc-dialog * { box-sizing: border-box; }
.tc h2, .tc h3, .tc p { margin-top: 0; }
.tc h2 { font-size: 1.18rem; }
.tc h3 { font-size: 1.03rem; }
.tc p { margin-bottom: .75rem; }
.tc a, .tc-dialog a { color: #8edcfa; text-underline-offset: 3px; }
.tc button, .tc-dialog button { min-height: 44px; }
.tc button:disabled, .tc-dialog button:disabled { opacity: .5; cursor: not-allowed; }
.tc button.secondary, .tc-dialog button.secondary { background: #203f50; border: 1px solid #456576; }
.tc .tc-muted, .tc-dialog .tc-muted { color: var(--tc-muted, #b2c8d4); }
.tc-small { font-size: .83rem; line-height: 1.5; }
.tc-kicker { color: #91c5d2; letter-spacing: .13em; font-size: .71rem; font-weight: 800; text-transform: uppercase; }
.tc-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.tc-header-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.tc-header-symbols { display: flex; gap: 5px; flex: 0 0 auto; }
.tc-header-symbols span { width: 43px; height: 43px; display: grid; place-items: center; border: 1px solid #627d85; border-radius: 12px; background: #183544; box-shadow: inset 0 1px 0 #ffffff18, 0 5px 14px #0003; }
.tc-header-symbols .fire { color: #f4ae79; border-color: #a3674e; background: #48332e; }
.tc-header-symbols .ems { color: #a9e9d6; border-color: #4b897d; background: #234841; }
.tc-header-symbols svg { width: 26px; height: 26px; }
.tc-header p { color: var(--tc-muted); max-width: 660px; margin: 6px 0 0; }
.tc-header h2 { font-size: 1.55rem; margin: 4px 0 0; }
.tc-header-actions, .tc-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tc-actions { margin: 12px 0; }
.tc-toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; margin: 16px 0; }
.tc-toolbar label { margin: 0; flex: 1; min-width: 175px; }
.tc-toolbar label input, .tc-toolbar label select { margin-top: 4px; }
.tc-toolbar button { flex-shrink: 0; }
.tc-tabs { display: flex; gap: 5px; border-bottom: 1px solid var(--tc-border); margin: 16px 0 22px; overflow-x: auto; padding-bottom: 9px; }
.tc-tabs button { color: #c0d2dd; background: transparent; white-space: nowrap; border: 1px solid transparent; border-radius: 8px; padding: 10px 15px; }
.tc-tabs button[aria-current="page"] { color: white; background: #21516a; border-color: #4f839a; }
.tc-subtabs { margin: 18px 0; }
.tc-subtabs button { padding: 8px 12px; font-size: .9rem; }
.tc-panel { padding: 20px; background: var(--tc-panel); border: 1px solid var(--tc-border); border-radius: 14px; margin: 14px 0; min-width: 0; }
.tc-panel > :last-child { margin-bottom: 0; }
.tc-panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.tc-panel-title h2, .tc-panel-title h3 { margin: 0; }
.tc-history-title { margin-top: 28px; }
.tc-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 18px 0; }
.tc-stat { padding: 17px; background: #102b3a; border: 1px solid var(--tc-border); border-radius: 12px; }
.tc-stat strong { display: block; font-size: 1.8rem; line-height: 1.2; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.tc-stat span { font-size: .82rem; color: var(--tc-muted); }
.tc-tag { display: inline-flex; align-items: center; width: fit-content; padding: 4px 9px; border: 1px solid #476675; border-radius: 6px; font-size: .73rem; font-weight: 700; line-height: 1.3; white-space: normal; background: #1a3545; }
.tc-tag.good { color: #9ee6cc; border-color: #39756a; background: #143e38; }
.tc-tag.warn { color: #ffe0ac; border-color: #8a7348; background: #443b28; }
.tc-tag.bad { color: #ffd0ca; border-color: #a26b64; background: #502f32; }
.tc-tag.neutral { color: #c0d3e2; border-color: #4c6377; background: #223c50; }
.tc-clocks { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin: 18px 0; }
.tc-clock { border: 1px solid var(--tc-border); border-top: 4px solid var(--tc-teal); border-radius: 15px; padding: 21px; background: #102b3a; min-width: 0; }
.tc-clock.fire { border-top-color: #e5ac75; }
.tc-clock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.tc-clock-label { display: flex; gap: 10px; align-items: center; font-size: .95rem; font-weight: 800; letter-spacing: .07em; }
.tc-clock-label svg { width: 23px; height: 23px; color: var(--tc-teal); }
.tc-clock.fire .tc-clock-label svg { color: #edbd91; }
.tc-clock-number { font-size: 2.4rem; font-weight: 750; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.tc-clock-number span { font-size: .92rem; font-weight: 500; letter-spacing: 0; color: var(--tc-muted); margin-left: 7px; }
.tc-clock-number.unknown { font-size: 1.45rem; letter-spacing: -.01em; }
.tc-clock-date { font-size: .94rem; color: var(--tc-muted); margin-bottom: 14px; }
.tc-clock-deadline { min-height: 2.8em; color: #dce9ef; font-size: .91rem; }
.tc-clock-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: .8rem; color: var(--tc-muted); }
.tc-meter { height: 9px; background: #071c28; border: 1px solid #315261; border-radius: 8px; overflow: hidden; width: 100%; }
.tc-meter > span { height: 100%; display: block; background: #60cabb; border-radius: 8px; transition: width .25s ease; }
.tc-meter.warn > span { background: #d6b172; }
.tc-meter.neutral > span { background: #729bb4; }
.tc-cycle { margin: 15px 0; border: 1px solid var(--tc-border); border-radius: 13px; overflow: hidden; background: #102b3a; }
.tc-cycle > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 19px; background: #163545; list-style: none; }
.tc-cycle > summary::after { content: "+"; font-size: 1.4rem; color: #9ed1dd; }
.tc-cycle[open] > summary::after { content: "−"; }
.tc-cycle > summary::-webkit-details-marker, .tc-requirement > summary::-webkit-details-marker { display: none; }
.tc-cycle summary h3 { margin: 0 0 5px; font-size: 1.1rem; }
.tc-cycle-main { flex: 1; min-width: 0; }
.tc-cycle-main .tc-small { color: var(--tc-muted); }
.tc-cycle-body { padding: 0 19px 18px; }
.tc-cycle-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; padding: 17px 0; }
.tc-cycle-meta dt { font-size: .73rem; color: var(--tc-muted); margin-bottom: 3px; }
.tc-cycle-meta dd { margin: 0; font-size: .87rem; overflow-wrap: anywhere; }
.tc-requirement { border-top: 1px solid #2e4c5d; padding: 0; }
.tc-requirement > summary { display: grid; grid-template-columns: minmax(130px,1fr) 125px minmax(80px,150px) 18px; gap: 12px; align-items: center; cursor: pointer; padding: 15px 0; list-style: none; }
.tc-requirement > summary::after { content: "›"; color: #a8c8d6; text-align: right; }
.tc-requirement[open] > summary::after { transform: rotate(90deg); }
.tc-req-label { font-size: .91rem; font-weight: 650; }
.tc-req-label small { display: block; font-weight: 400; font-size: .73rem; color: var(--tc-muted); margin-top: 3px; }
.tc-req-numbers { font-size: .88rem; text-align: right; font-variant-numeric: tabular-nums; }
.tc-req-numbers small { display: block; color: var(--tc-muted); font-size: .72rem; }
.tc-req-detail { padding: 0 0 14px 13px; color: var(--tc-muted); font-size: .85rem; border-left: 2px solid #416374; margin-bottom: 14px; }
.tc-req-detail p { margin-bottom: 8px; }
.tc-group-label { background: #1a4054; color: #d5edf4; font-size: .75rem; font-weight: 800; letter-spacing: .055em; padding: 8px 11px; border-radius: 6px; margin-top: 14px; }
.tc-empty { text-align: center; border: 1px dashed #3f6071; padding: 26px 20px; border-radius: 12px; margin: 14px 0; color: var(--tc-muted); }
.tc-empty h3 { color: #e5f1f8; margin-bottom: 6px; }
.tc-empty p { max-width: 610px; margin: 0 auto 14px; }
.tc-list { list-style: none; padding: 0; margin: 0; }
.tc-list li { padding: 12px 0; border-bottom: 1px solid #2e4c5b; }
.tc-list li:last-child { border: 0; }
.tc-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.tc-row-main { min-width: 0; flex: 1; }
.tc-row-main strong { display: block; overflow-wrap: anywhere; }
.tc-row-meta { font-size: .81rem; color: var(--tc-muted); margin-top: 4px; overflow-wrap: anywhere; }
.tc-evidence-list { padding-left: 20px; margin: 8px 0; }
.tc-evidence-list li { margin-bottom: 7px; }
.tc-link-button { border: 0; background: transparent; padding: 5px 0; min-height: 36px !important; color: #8edcfa; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.tc-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.tc-table-wrap { overflow: auto; border: 1px solid var(--tc-border); border-radius: 12px; }
.tc table { min-width: 660px; font-size: .87rem; }
.tc th { color: #b5d2df; background: #183647; font-size: .77rem; letter-spacing: .03em; }
.tc td { vertical-align: top; }
.tc td small { display: block; color: var(--tc-muted); margin-top: 4px; }
.tc-notice { padding: 12px 15px; background: #153d4b; border: 1px solid #3e7387; border-radius: 8px; font-size: .88rem; margin: 12px 0; }
.tc-notice.warn { background: #3b3324; border-color: #90794b; color: #ffe0ac; }
.tc-notice.bad { background: #432c32; border-color: #955f64; color: #ffd1d3; }
.tc-notice.good { background: #143d37; border-color: #3b7c6b; color: #b8f1d6; }
.tc-error:empty, .tc-dialog-error:empty { display: none; }
.tc-error, .tc-dialog-error { background: #442c32; border: 1px solid #b16c78; color: #ffdee1; border-radius: 8px; padding: 11px 13px; margin: 10px 0; }
.tc-code { font-family: ui-monospace,monospace; font-size: .79rem; white-space: pre-wrap; overflow-wrap: anywhere; background: #0c202d; border: 1px solid #355263; border-radius: 8px; padding: 12px; max-height: 330px; overflow: auto; }
.tc-dialog { --tc-muted: #b2c8d4; --tc-panel: #102b3a; --tc-border: #335666; border: 1px solid #52788c; border-radius: 15px; background: #102936; color: #eaf3f8; width: min(950px,calc(100vw - 28px)); max-height: 92vh; padding: 0; margin: auto; }
.tc-dialog.wide { width: min(1190px,calc(100vw - 28px)); }
.tc-dialog::backdrop { background: #020b12cc; }
.tc-dialog-head { display: flex; justify-content: space-between; gap: 15px; align-items: center; padding: 18px 22px; border-bottom: 1px solid #3a5869; }
.tc-dialog-head h2 { font-size: 1.2rem; margin: 0; }
.tc-dialog-body { padding: 20px 22px; }
.tc-dialog-close { background: #234353; border: 1px solid #526c7b; padding: 5px 13px; min-width: 44px; }
.tc-dialog label { color: #cfdfeb; margin: 0; font-size: .85rem; }
.tc-dialog label > input, .tc-dialog label > select, .tc-dialog label > textarea { margin-top: 5px; }
.tc-dialog input, .tc-dialog select, .tc-dialog textarea { background: #0b2230; color: #edf6fa; border-color: #516f80; min-height: 45px; }
.tc-dialog textarea { min-height: 85px; resize: vertical; }
.tc-dialog label { display: block; }
.tc-dialog label > input, .tc-dialog label > select, .tc-dialog label > textarea { width: 100%; }
.tc-dialog label > small { display: block; color: var(--tc-muted); line-height: 1.45; margin-top: 5px; }
.tc-dialog .tc-check { margin-top: 10px; }
.tc-dialog summary { cursor: pointer; min-height: 38px; }
.tc-pre-line { white-space: pre-line; }
.tc-certificate { display: block; width: 100%; max-height: 600px; object-fit: contain; margin-top: 12px; background: white; }
.tc-list-item { padding: 12px 0; border-bottom: 1px solid #365567; }
.tc-primary-link, .tc .primary-link { display: inline-flex; align-items: center; padding: 10px 14px; min-height: 44px; background: #214e62; border: 1px solid #527f95; border-radius: 8px; text-decoration: none; }
.tc :focus-visible, .tc-dialog :focus-visible { outline: 3px solid #8ad9e3; outline-offset: 3px; }
.tc-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 17px; }
.tc-form-grid .full { grid-column: 1 / -1; }
.tc-form-section { margin: 18px 0; padding-top: 16px; border-top: 1px solid #365567; }
.tc-form-section h3 { font-size: 1rem; margin: 0 0 12px; }
.tc-form-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; padding-top: 18px; margin-top: 18px; border-top: 1px solid #365567; }
.tc-form-actions button[type=submit] { background: #237d80; border: 1px solid #59aca7; }
.tc-check { display: flex !important; align-items: center; gap: 10px; border: 1px solid #395b6d; padding: 10px 12px; border-radius: 8px; min-height: 46px; }
.tc-check input { width: 19px; height: 19px; min-height: 19px !important; flex: 0 0 19px; accent-color: #6bd6c6; margin: 0 !important; }
.tc-check span { flex: 1; }
.tc-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.tc-upload { border: 1px dashed #5b8497; border-radius: 10px; background: #123344; padding: 16px; margin-bottom: 16px; }
.tc-upload input[type=file] { background: transparent; padding: 8px 0; border: 0; }
.tc-upload p { font-size: .8rem; color: #b7cfdd; margin: 8px 0; }
.tc-upload-status { margin-top: 10px; font-size: .85rem; }
.tc-review-layout { display: grid; grid-template-columns: minmax(270px,.85fr) minmax(330px,1.15fr); gap: 20px; }
.tc-document { background: #0b202c; border: 1px solid #426578; border-radius: 10px; padding: 12px; min-width: 0; }
.tc-document iframe { width: 100%; height: 470px; border: 0; background: white; border-radius: 5px; }
.tc-document p { margin: 8px 0; }
.tc-document-sticky { position: sticky; top: 0; }
.tc-allocation-row { display: grid; grid-template-columns: minmax(140px,1fr) minmax(140px,1fr) 85px 44px; gap: 8px; align-items: end; margin: 9px 0; padding: 10px; border: 1px solid #3e6172; border-radius: 9px; background: #0f2e3d; }
.tc-allocation-row button { background: #51373d; }
.tc-allocation-row small { grid-column: 1 / -1; color: #bdd2dd; }
.tc-people-picker { max-height: 230px; overflow-y: auto; padding-right: 4px; }
.tc-table-form { overflow: auto; }
.tc-table-form table { min-width: 540px; }
.tc-table-form th, .tc-table-form td { padding: 9px; }
.tc-table-form input[type=checkbox] { width: 20px; min-height: 20px; accent-color: #68d1c3; }
.tc-table-form input[type=number] { width: 95px; }
.tc-table-form select { min-width: 140px; }
.tc-done { color: #b0e6ca; }
.tc-source-link { display: inline-block; margin: 4px 14px 4px 0; font-size: .8rem; }
.tc-breadcrumb { color: var(--tc-muted); margin-bottom: 8px; font-size: .82rem; }
.tc-spinner { width: 23px; height: 23px; border: 2px solid #456275; border-top-color: #7ce2d2; border-radius: 50%; display: inline-block; animation: tc-spin .8s linear infinite; margin-right: 10px; vertical-align: middle; }
.tc-file-toolbar { border: 1px solid var(--tc-border); background: #143443; border-radius: 12px; padding: 14px 17px; margin: 16px 0; }
.tc-file-selection { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.tc-file-select { display: flex !important; align-items: center; gap: 9px; margin: 0; min-height: 44px; font-size: .86rem; }
.tc-file-select input, .tc-file-checkbox input { width: 21px; height: 21px; min-height: 21px; margin: 0; accent-color: var(--tc-teal); }
.tc-file-group { border: 1px solid var(--tc-border); border-radius: 12px; margin: 16px 0; overflow: hidden; background: var(--tc-panel); }
.tc-file-group > summary { display: flex; align-items: center; gap: 10px; padding: 15px 18px; background: #193e51; cursor: pointer; min-height: 55px; font-weight: 750; list-style: none; }
.tc-file-group > summary::-webkit-details-marker { display: none; }
.tc-file-group > summary::after { content: "+"; margin-left: 6px; font-size: 1.3rem; }
.tc-file-group[open] > summary::after { content: "−"; }
.tc-file-count { margin-left: auto; padding: 3px 9px; background: #0c2737; border-radius: 6px; font-size: .8rem; font-variant-numeric: tabular-nums; }
.tc-file-group-body { padding: 0 18px 13px; }
.tc-file-group-body > p { margin-top: 14px; }
.tc-file-subgroup h3 { color: #9cdedb; font-size: .84rem; margin: 17px 0 7px; letter-spacing: .025em; }
.tc-file-list { list-style: none; padding: 0; margin: 0; }
.tc-file-row { padding: 15px 0; border-top: 1px solid #355465; }
.tc-file-row-heading { display: flex; gap: 12px; align-items: flex-start; }
.tc-file-checkbox { flex: 0 0 30px; display: flex !important; min-height: 38px; align-items: flex-start; padding-top: 2px; margin: 0 !important; }
.tc-file-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tc-file-row-actions { margin: 10px 0 0 42px; gap: 7px; }
.tc-file-row-actions button, .tc-file-download { font-size: .8rem; }
.tc-file-download { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid #456576; background: #203f50; border-radius: 7px; text-decoration: none; }
.tc-simple-intro, .tc-simple-status { padding: 14px 17px; background: #143d42; border: 1px solid #47847d; border-radius: 10px; line-height: 1.5; }
.tc-simple-status { margin: 12px 0 18px; }
.tc-simple-form { margin: 18px 0; }
.tc-simple-more { margin: 16px 0; }
.tc-simple-more summary { font-weight: 700; }
.tc-simple-more .tc-form-grid { margin-top: 16px; }
.tc-submission-summary { margin: 16px 0; }
.tc-submission-summary .tc-actions { margin: 0; }
.tc button.tc-danger, .tc-dialog button.tc-danger, .tc-dialog .tc-form-actions button.tc-danger { color: #ffe1dd; background: #59363e; border-color: #ad7781; }
.tc-print-preview { display: block; width: 100%; height: min(64vh,800px); min-height: 320px; border: 1px solid #52788c; border-radius: 8px; background: white; }
@keyframes tc-spin { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { .tc-spinner { animation: none; } .tc-meter > span { transition: none; } }
@media(max-width:900px) {
  .tc-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tc-review-layout { grid-template-columns: 1fr; }
  .tc-document iframe { height: 300px; }
  .tc-document-sticky { position: static; }
}
@media(max-width:620px) {
  .tc-header { flex-direction: column; align-items: stretch; }
  .tc-header-actions button { flex: 1; }
  .tc-clocks, .tc-grid { grid-template-columns: 1fr; }
  .tc-clock { padding: 18px; }
  .tc-panel { padding: 16px; }
  .tc-tabs button { padding: 9px 12px; font-size: .85rem; }
  .tc-cycle > summary { padding: 15px; }
  .tc-cycle-body { padding: 0 14px 15px; }
  .tc-cycle-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .tc-requirement > summary { grid-template-columns: minmax(0,1fr) 100px 14px; gap: 8px; }
  .tc-requirement .tc-meter { grid-column: 1 / 3; grid-row: 2; }
  .tc-requirement > summary::after { grid-column: 3; grid-row: 1; }
  .tc-req-label { font-size: .85rem; }
  .tc-row { flex-direction: column; gap: 8px; }
  .tc-form-grid, .tc-check-grid { grid-template-columns: 1fr; }
  .tc-dialog { width: calc(100vw - 16px); max-height: 96vh; }
  .tc-dialog-head { padding: 14px; }
  .tc-dialog-body { padding: 14px; }
  .tc-allocation-row { grid-template-columns: minmax(0,1fr) 75px 44px; }
  .tc-allocation-row > label:first-child { grid-column: 1 / -1; }
  .tc-allocation-row > label:nth-child(2) { grid-column: 1; }
  .tc-allocation-row > label:nth-child(3) { grid-column: 2; }
  .tc-form-actions button { flex: 1; }
  .tc-file-row-actions { margin-left: 0; }
  .tc-file-row-actions button, .tc-file-download { flex: 1 1 auto; justify-content: center; }
  .tc-file-toolbar { padding: 12px; }
  .tc-file-group-body { padding: 0 12px 10px; }
  .tc-file-group > summary { padding: 13px; }
}
@media print {
  .tc { color: #111; }
  .tc-tabs, .tc-actions, .tc-toolbar, .tc-header-actions, .tc-file-toolbar, .tc-file-checkbox { display: none !important; }
  .tc-clock, .tc-panel, .tc-cycle, .tc-stat { background: white; color: #111; border-color: #bbb; break-inside: avoid; }
  .tc .tc-muted, .tc-cycle-main .tc-small, .tc-row-meta, .tc-clock-date { color: #444; }
}
/* 2.2 tools stay behind the existing Training Center buttons. */
.tc-tools-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:14px}
.tc-block{display:block}
.tc-dialog fieldset{min-width:0;border:1px solid #cbd5e1;border-radius:10px}
.tc-dialog legend{padding:0 8px;font-weight:700}
.tc-dialog [hidden]{display:none!important}
.tc-dialog .table-scroll{overflow:auto;max-width:100%}
.tc-dialog .tc-table-wrap{overflow:auto;max-width:100%}
.tc-dialog .tc-table-wrap small{display:block}
.tc-dialog table{width:100%;border-collapse:collapse}
.tc-dialog th,.tc-dialog td{padding:10px;text-align:left;vertical-align:top;border-bottom:1px solid #dbe3ea}
@media(max-width:650px){.tc-dialog .tc-allocation-row{grid-template-columns:1fr}.tc-header-actions{flex-wrap:wrap}.tc-tools-grid{grid-template-columns:1fr}}
