:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef3f5;
  color: #102433;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; overflow-x: auto; background: radial-gradient(circle at top right, #d7f4ec, transparent 32rem), #eef3f5; }
button, input, select, textarea { font: inherit; }
.shell { width: min(1500px, calc(100% - 32px)); min-width: 1050px; margin: 0 auto; padding: 28px 0 60px; }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.mark { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: #19b98b; color: white; font-weight: 800; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 1.5rem; }
h2 { margin-bottom: 8px; }
.eyebrow { margin-bottom: 4px; color: #537080; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.card { background: rgba(255,255,255,.92); border: 1px solid rgba(16,36,51,.08); border-radius: 22px; padding: 24px; box-shadow: 0 18px 50px rgba(33,63,74,.08); }
.login-card { max-width: 470px; margin: 56px auto; }
form, #start-controls { display: grid; gap: 16px; margin-top: 24px; }
label { display: grid; gap: 7px; font-size: .85rem; font-weight: 700; color: #405966; }
input, select, textarea { width: 100%; border: 1px solid #cbd8dc; border-radius: 12px; padding: 12px 14px; background: white; color: #102433; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #19a97f; box-shadow: 0 0 0 3px rgba(25,169,127,.14); }
textarea { min-height: 110px; resize: vertical; }
button { border: 0; border-radius: 12px; padding: 12px 18px; background: #0d2235; color: white; font-weight: 750; cursor: pointer; }
button:hover { filter: brightness(1.08); }
button:disabled { opacity: .55; cursor: wait; }
.secondary { background: #e8eff1; color: #183442; }
.danger { background: #d84d5b; width: 100%; margin-top: 20px; }
.muted { color: #66808d; }
.error { min-height: 1.2em; margin: 14px 0 0; color: #bf3042; font-size: .9rem; }
.hidden { display: none !important; }
.toolbar, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; }
.toolbar { margin-bottom: 18px; }
.timer { margin-bottom: 18px; }
.timer + .card { margin-bottom: 18px; }
#app-view { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.app-tabs { position: sticky; top: 18px; grid-column: 1; display: grid; gap: 10px; padding: 14px; }
.tab-button { width: 100%; text-align: left; }
.tab-button:not(.active) { background: #e8eff1; color: #183442; }
.tab-panel { grid-column: 2; grid-row: 1; min-width: 0; }
.main-column { display: grid; gap: 18px; min-width: 0; }
.main-column > * { min-width: 0; margin: 0; }
#timer-value { margin: 22px 0; font-variant-numeric: tabular-nums; font-size: clamp(3rem, 13vw, 5.5rem); font-weight: 800; letter-spacing: -.06em; }
.history { display: grid; gap: 10px; margin-top: 18px; overflow-x: auto; }
.history-record { min-width: 740px; }
.history-record.editing { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 410px); align-items: start; gap: 14px; padding: 10px 0; border-top: 1px solid #dce7e8; }
.history-record.editing .history-item { border-top: 0; }
.inline-entry-editor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 14px; border: 1px solid #cfe6df; border-radius: 14px; background: #edf7f4; white-space: normal; }
.inline-entry-editor h3, .inline-entry-description, .inline-entry-actions, .inline-entry-editor .error { grid-column: 1 / -1; }
.inline-entry-editor h3 { margin: 0; font-size: 1rem; }
.inline-entry-editor label { min-width: 0; font-size: .75rem; }
.inline-entry-editor input, .inline-entry-editor select { min-width: 0; padding: 9px 10px; }
.inline-entry-actions { display: flex; gap: 8px; }
.inline-entry-actions button { flex: 1; padding: 9px 12px; }
.history-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.history-filters label { min-width: 0; }
.history-date-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.history-date-filters label { min-width: 0; }
.history-summary { display: flex; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #edf7f4; font-size: .9rem; font-weight: 800; }
.show-settled, .settlement-status { display: flex; grid-template-columns: none; align-items: center; gap: 7px; }
.show-settled { margin-top: 12px; }
.show-settled input, .settlement-status input { width: auto; }
.history-item { display: grid; grid-template-columns: minmax(190px, 1.55fr) minmax(105px, .75fr) 72px 82px 94px 104px; align-items: center; gap: 5px; width: 100%; min-width: 0; padding: 10px 0; border-top: 1px solid #e4ecee; white-space: nowrap; }
.settlement-status { min-width: 0; font-size: .72rem; font-weight: 700; color: #526d7a; }
.history-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.history-item strong { margin-right: 8px; }
.history-item small { color: #718892; font-size: .76rem; }
.history-rate { min-width: 0; overflow: hidden; color: #526d7a; font-size: .76rem; text-overflow: ellipsis; }
.duration { font-variant-numeric: tabular-nums; font-weight: 800; }
.session-amount { min-width: 0; overflow: hidden; color: #167b60; font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; text-overflow: ellipsis; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.projects-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.assignment-form { max-width: 760px; }
.assignment-form fieldset { display: grid; gap: 10px; margin: 0; padding: 16px; border: 1px solid #dce7e8; border-radius: 12px; }
.assignment-form legend { padding: 0 6px; color: #405966; font-size: .85rem; font-weight: 800; }
.category-checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.category-checklist label { display: flex; grid-template-columns: none; align-items: center; gap: 8px; padding: 10px; border-radius: 10px; background: white; }
.category-checklist input { width: auto; }
.project-category-sections { display: grid; gap: 18px; margin-top: 22px; }
.project-category-card { display: grid; grid-template-columns: minmax(430px, .95fr) minmax(450px, 1.05fr); align-items: end; gap: 12px 16px; min-width: 0; padding: 14px 16px; border: 1px solid #dce7e8; border-radius: 16px; background: #f4f8f8; }
.category-heading { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(350px, auto); align-items: end; gap: 12px; min-width: 0; }
.category-heading h3 { align-self: center; margin: 0; font-size: 1.02rem; }
.category-dates { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)) auto; align-items: end; gap: 7px; }
.category-dates label { font-size: .75rem; }
.category-dates input, .category-dates button { min-height: 39px; padding: 9px 11px; }
.category-dates button { white-space: nowrap; }
.project-notes { display: grid; grid-column: 1 / -1; gap: 10px; margin-top: 0; padding-top: 12px; border-top: 1px solid #dce7e8; }
.project-note { min-width: 0; padding: 14px; border: 1px solid #cfe6df; border-radius: 12px; background: #edf7f4; transition: background-color .18s, border-color .18s, box-shadow .18s; }
.project-note.dirty { border-color: #d5dee1; background: white; box-shadow: 0 4px 14px rgba(16,36,51,.07); }
.note-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.note-heading > div { min-width: 0; }
.note-heading strong { display: block; overflow-wrap: anywhere; }
.note-heading small { display: block; margin-top: 3px; color: #718892; font-size: .72rem; }
.note-content-input { min-height: 130px; margin-top: 12px; }
.note-checklist { display: grid; gap: 7px; margin-top: 12px; }
.note-actions { display: flex; gap: 6px; }
.autosave-status { align-self: center; color: #66808d; font-size: .72rem; font-weight: 750; }
.project-note.dirty .autosave-status { color: #a06a13; }
.note-edit-button { flex: 0 0 auto; padding: 7px 10px; font-size: .78rem; }
.note-title-edit { flex: 1; min-width: 0; }
.note-title-edit input { font-weight: 750; }
.note-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 7px; padding: 3px 7px; border-radius: 8px; background: rgba(255,255,255,.68); font-weight: 600; }
.note-item input { flex: 0 0 auto; width: auto; margin-top: 3px; }
.note-item .note-item-input { width: 100%; min-height: 32px; margin: 0; padding: 5px 8px; border-radius: 7px; font-size: .82rem; }
.note-item.completed .note-item-input { color: #718892; text-decoration: line-through; }
.new-note-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 3px; }
.note-form { grid-template-columns: minmax(130px, .45fr) minmax(190px, 1fr) auto; align-items: end; gap: 7px; min-width: 0; margin: 0; padding: 0; }
.note-form label { min-width: 0; font-size: .75rem; }
.note-form input, .note-form select, .note-form button { min-width: 0; min-height: 39px; padding: 9px 11px; }
.note-form button { white-space: nowrap; }
.empty-project-categories { margin: 20px 0 0; }
.config-form { align-content: start; margin: 0; padding: 17px; border-radius: 15px; background: #f4f8f8; }
.config-form h3 { margin: 0; font-size: 1rem; }
.message { min-height: 1.2em; margin: 16px 0 0; color: #167b60; font-weight: 700; }
.config-list { display: grid; gap: 7px; margin-top: 8px; padding-top: 14px; border-top: 1px solid #dce7e8; }
.config-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 8px 0; }
.config-item span { overflow: hidden; text-overflow: ellipsis; font-size: .86rem; font-weight: 650; }
.config-item span small { display: block; margin-top: 3px; color: #718892; font-weight: 500; }
.delete-button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #e4aab1; background: transparent; color: #b72e3e; font-size: .78rem; }
.config-actions, .form-actions { display: flex; gap: 7px; align-items: center; }
.config-actions button { padding: 7px 10px; font-size: .78rem; }
.form-actions button { flex: 1; }
.manual-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 18px; min-width: 0; }
.manual-grid > *, .manual-grid label, .manual-grid input, .manual-grid select { min-width: 0; max-width: 100%; }
.manual-description { grid-column: 1 / -1; }
.manual-actions { grid-column: 1 / -1; display: flex; gap: 10px; }
.manual-actions button { flex: 1; }
.entry-actions { display: flex; gap: 3px; min-width: 0; justify-content: flex-end; white-space: nowrap; }
.entry-actions button { min-width: 0; padding: 6px; font-size: .68rem; }
.cost-form { display: grid; grid-template-columns: 1.1fr 1fr .72fr 1.35fr .55fr .8fr; align-items: end; gap: 9px; margin-top: 18px; padding: 14px; border-radius: 14px; background: #f4f8f8; }
.cost-form label { min-width: 0; font-size: .75rem; }
.cost-form input, .cost-form select, .cost-form button { min-width: 0; min-height: 40px; padding: 9px 11px; }
.cost-comment { grid-column: 1 / span 4; }
.cost-settled { display: flex; grid-template-columns: none; align-items: center; align-self: center; gap: 7px; padding-top: 20px; white-space: nowrap; }
.cost-settled input { width: auto; min-height: auto; }
.cost-form-actions { display: flex; gap: 7px; }
.cost-form-actions button { flex: 1; white-space: nowrap; }
.cost-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.cost-filters .show-settled { grid-column: 1 / -1; margin-top: 0; }
.cost-list { display: grid; margin-top: 12px; }
.cost-item { display: grid; grid-template-columns: minmax(190px, 1.3fr) minmax(105px, .7fr) 125px minmax(100px, .8fr) 90px 105px auto; align-items: center; gap: 8px; min-width: 0; padding: 10px 0; border-top: 1px solid #e4ecee; }
.cost-main, .cost-category, .cost-comment-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-main strong, .cost-main small { display: block; }
.cost-main small, .cost-category, .cost-comment-value { color: #718892; font-size: .76rem; }
.cost-quantity { color: #526d7a; font-size: .8rem; white-space: nowrap; }
.cost-amount { color: #167b60; font-variant-numeric: tabular-nums; font-weight: 800; text-align: right; white-space: nowrap; }
.cost-details { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid #cfe6df; border-radius: 11px; background: #edf7f4; }
.cost-details > div { min-width: 0; padding: 10px; border-radius: 9px; background: rgba(255,255,255,.72); }
.cost-details-label { color: #526d7a; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cost-details p { min-height: 1.4em; margin: 6px 0 10px; overflow-wrap: anywhere; white-space: pre-wrap; user-select: text; }
.cost-copy { padding: 7px 10px; font-size: .76rem; }
.know-how-toolbar { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); align-items: end; gap: 14px; margin-top: 18px; }
.know-how-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin: 0; }
.know-how-create-form button { min-height: 45px; white-space: nowrap; }
.know-how-search { min-width: 0; }
.know-how-hint { margin: 12px 0 0; font-size: .82rem; }
.know-how-list { display: grid; gap: 9px; margin-top: 12px; }
.know-how-note { min-width: 0; overflow: hidden; border: 1px solid #d9e5e8; border-radius: 13px; background: #f4f8f8; transition: border-color .18s, background-color .18s, box-shadow .18s; }
.know-how-note.dirty { border-color: #d5dee1; background: white; box-shadow: 0 5px 16px rgba(16,36,51,.08); }
.know-how-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; min-height: 58px; }
.know-how-toggle { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 12px; min-width: 0; border-radius: 0; padding: 12px 16px; background: #e8f1f1; color: #102433; text-align: left; }
.know-how-toggle span { min-width: 0; overflow: hidden; font-size: .96rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.know-how-toggle small { color: #66808d; font-size: .72rem; font-weight: 600; white-space: nowrap; }
.know-how-toggle b { color: #167b60; font-size: 1.35rem; text-align: center; }
.know-how-bar > .delete-button { align-self: center; margin: 0 10px; }
.know-how-body { padding: 16px; border-top: 1px solid #d9e5e8; }
.know-how-title-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.know-how-title-row input { font-weight: 750; }
.know-how-editor-toolbar { display: flex; gap: 6px; margin: 12px 0 6px; }
.know-how-editor-toolbar button { min-width: 42px; padding: 7px 10px; font-size: .8rem; }
.know-how-editor { min-height: 220px; max-height: 70vh; overflow: auto; border: 1px solid #cbd8dc; border-radius: 12px; padding: 14px; background: white; line-height: 1.55; outline: none; }
.know-how-editor:focus { border-color: #19a97f; box-shadow: 0 0 0 3px rgba(25,169,127,.14); }
.know-how-editor:empty::before { content: attr(data-placeholder); color: #8599a2; pointer-events: none; }
.know-how-editor img { display: block; width: auto; max-width: min(100%, 900px); max-height: 620px; margin: 14px auto; border-radius: 10px; object-fit: contain; box-shadow: 0 5px 18px rgba(16,36,51,.12); }
.know-how-editor p, .know-how-editor div { margin: 0 0 .75em; }
.know-how-note.dirty [data-knowledge-status] { color: #a06a13; }
@media (max-width: 520px) { .shell { width: min(100% - 20px, 760px); padding-top: 20px; } .card { padding: 19px; border-radius: 18px; } .section-heading { align-items: flex-start; } }
@media (max-width: 720px) { .config-grid, .manual-grid { grid-template-columns: 1fr; } .manual-description, .manual-actions { grid-column: auto; } }
@media (max-width: 1320px) { .cost-form { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cost-comment { grid-column: 1 / span 2; } .cost-item { grid-template-columns: minmax(180px, 1fr) 100px 115px minmax(90px, .7fr) 85px 100px auto; } }
@media (max-width: 1220px) { .project-category-card { grid-template-columns: 1fr; } .project-notes { grid-column: auto; } }
@media (max-width: 820px) { .category-heading { grid-template-columns: 1fr; } .category-dates { grid-template-columns: 1fr 1fr; } .category-dates button { grid-column: 1 / -1; } .note-form, .cost-form, .cost-filters, .cost-details { grid-template-columns: 1fr; } .cost-comment, .cost-filters .show-settled { grid-column: auto; } .cost-settled { padding-top: 0; } .cost-item { grid-template-columns: 1fr auto; } .cost-category, .cost-quantity, .cost-comment-value { grid-column: 1; } .cost-item .settlement-status, .cost-item .entry-actions { grid-column: 2; } .new-note-item { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .know-how-toolbar, .know-how-create-form { grid-template-columns: 1fr; } .know-how-toggle { grid-template-columns: minmax(0, 1fr) 24px; } .know-how-toggle small { display: none; } .know-how-title-row { grid-template-columns: 1fr; } }
@media (max-width: 1180px) { .history-record.editing { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .history-filters, .history-date-filters { grid-template-columns: 1fr; } .history-summary { flex-direction: column; gap: 4px; } }
