.notes-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 560px; gap: 24px; color: var(--ink, #152925); }
.notes-sidebar { display: flex; flex-direction: column; gap: 18px; min-width: 0; padding: 24px 18px; background: var(--surface, #fff); border: 1px solid var(--border, #e3e8e3); border-radius: var(--radius, 24px); }
.notes-sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.notes-sidebar-heading h2 { margin: 0; font-size: 15px; letter-spacing: -.02em; }
.notes-count { display: grid; place-items: center; min-width: 25px; height: 25px; padding: 0 7px; border-radius: 8px; color: var(--accent, #176b56); background: var(--canvas, #f5f6f2); font-size: 12px; font-weight: 700; }
.notes-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 9px 13px; border: 1px solid var(--border, #e3e8e3); border-radius: 11px; background: var(--surface, #fff); color: var(--ink, #152925); font: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }
.notes-btn:hover { background: var(--canvas, #f5f6f2); border-color: var(--muted, #78847c); }
.notes-btn:active { transform: translateY(1px); }
.notes-btn:focus-visible, .notes-input:focus-visible, .notes-title-input:focus-visible { outline: 2px solid var(--accent, #176b56); outline-offset: 3px; }
.notes-btn-primary { background: var(--accent, #176b56); color: #fff; border-color: var(--accent, #176b56); }
.notes-btn-primary:hover { background: var(--accent, #176b56); filter: brightness(1.08); }
.notes-new { width: 100%; min-height: 44px; font-size: 13px; }
.notes-list { display: flex; flex-direction: column; gap: 7px; }
.notes-entry { display: flex; align-items: flex-start; flex-direction: column; width: 100%; min-width: 0; gap: 7px; padding: 14px 13px; text-align: left; background: transparent; border-color: transparent; }
.notes-entry[aria-current="true"] { background: color-mix(in srgb, var(--accent, #176b56) 7%, var(--surface, #fff)); border-color: color-mix(in srgb, var(--accent, #176b56) 25%, var(--border, #e3e8e3)); }
.notes-name { display: block; width: 100%; font-size: 13px; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.notes-date { color: var(--muted, #78847c); font-size: 10px; font-weight: 400; }
.notes-preview { max-width: 100%; color: var(--accent, #176b56); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.notes-local-hint { margin: auto 4px 0; padding-top: 12px; color: var(--muted, #78847c); font-size: 11px; line-height: 1.75; }
.notes-sidebar-empty { margin: 12px 4px; color: var(--muted, #78847c); white-space: pre-line; font-size: 12px; line-height: 1.8; }
.notes-editor { min-width: 0; padding: 30px; background: var(--surface, #fff); border: 1px solid var(--border, #e3e8e3); border-radius: var(--radius, 24px); }
.notes-editor-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.notes-title-label { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 9px; }
.notes-title-label > span { font-size: 10px; font-weight: 650; color: var(--muted, #78847c); letter-spacing: .025em; }
.notes-title-input { min-width: 0; width: 100%; padding: 4px 0 8px; color: var(--ink, #152925); background: transparent; font: inherit; font-size: clamp(19px, 2.3vw, 25px); font-weight: 650; line-height: 1.3; letter-spacing: -.045em; border: 0; border-bottom: 1px solid transparent; border-radius: 2px; }
.notes-title-input:hover { border-bottom-color: var(--border, #e3e8e3); }
.notes-title-input::placeholder { color: var(--muted, #78847c); opacity: .65; }
.notes-saved { padding-top: 2px; color: var(--muted, #78847c); font-size: 10px; line-height: 1.5; white-space: nowrap; }
.notes-toolbar { display: flex; flex-wrap: wrap; gap: 7px; margin: 23px 0 25px; }
.notes-toolbar .notes-btn { min-height: 35px; padding: 8px 11px; font-size: 11px; }
.notes-delete-note { margin-left: auto; color: #a3473f; }
.notes-table { width: 100%; }
.notes-table-heading, .notes-row { display: grid; grid-template-columns: minmax(90px, 1.4fr) minmax(62px, .7fr) minmax(80px, 1fr) minmax(90px, 1.1fr) 32px; align-items: start; gap: 10px; }
.notes-table-heading { margin-bottom: 9px; padding: 0 2px; color: var(--muted, #78847c); font-size: 10px; }
.notes-table-heading > span:nth-child(4) { text-align: right; }
.notes-row { padding: 11px 0; border-bottom: 1px solid var(--border, #e3e8e3); }
.notes-field { display: block; min-width: 0; }
.notes-field-label { display: none; }
.notes-input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 42px; padding: 10px 11px; border: 1px solid var(--border, #e3e8e3); border-radius: 10px; background: var(--canvas, #f5f6f2); color: var(--ink, #152925); font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.notes-input::placeholder { color: var(--muted, #78847c); opacity: .65; }
.notes-input[aria-invalid="true"] { border-color: #b64f44; background: #fff5f3; color: #963d34; }
.notes-field-quantity .notes-input, .notes-field-unitPrice .notes-input { text-align: right; }
.notes-row-amount { align-self: center; min-width: 0; text-align: right; }
.notes-amount { display: block; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.notes-remove-row { align-self: center; min-width: 32px; min-height: 36px; padding: 5px; border-color: transparent; background: transparent; color: var(--muted, #78847c); font-size: 22px; font-weight: 400; }
.notes-remove-row:hover { color: #a3473f; background: #fff5f3; border-color: transparent; }
.notes-row-error { grid-column: 1 / -1; margin: 0; color: #a3473f; font-size: 11px; line-height: 1.6; }
.notes-add-row { margin-top: 15px; border-style: dashed; color: var(--accent, #176b56); font-size: 12px; }
.notes-total { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 28px; padding: 23px 21px; border-radius: 16px; background: color-mix(in srgb, var(--accent, #176b56) 7%, var(--surface, #fff)); }
.notes-total > div { flex-shrink: 0; }
.notes-total-label { display: block; color: var(--accent, #176b56); font-size: 13px; font-weight: 650; }
.notes-total-hint { display: block; margin-top: 5px; color: var(--muted, #78847c); font-size: 10px; }
.notes-total-value { min-width: 0; color: var(--accent, #176b56); font-size: clamp(20px, 2.7vw, 30px); font-weight: 700; letter-spacing: -.045em; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.notes-help { margin: 13px 2px 0; color: var(--muted, #78847c); font-size: 10px; line-height: 1.8; }
.notes-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 480px; text-align: center; }
.notes-empty-symbol { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 20px; border: 1px solid var(--border, #e3e8e3); border-radius: 18px; background: var(--canvas, #f5f6f2); color: var(--accent, #176b56); font-size: 38px; font-weight: 300; }
.notes-empty h2 { margin: 0; font-size: clamp(19px, 2vw, 24px); letter-spacing: -.04em; }
.notes-empty p { margin: 14px 0 25px; color: var(--muted, #78847c); white-space: pre-line; font-size: 12px; line-height: 1.95; }
.notes-storage-warning { padding: 13px 16px; border: 1px solid #e1bd7d; border-radius: 12px; background: #fff9e9; color: #795316; font-size: 12px; line-height: 1.7; }
.notes-dialog { box-sizing: border-box; width: min(420px, calc(100vw - 36px)); padding: 28px; border: 1px solid var(--border, #e3e8e3); border-radius: 22px; background: var(--surface, #fff); color: var(--ink, #152925); box-shadow: 0 22px 70px #102a2030; }
.notes-dialog::backdrop { background: #10201966; backdrop-filter: blur(3px); }
.notes-dialog h3 { margin: 0; font-size: 19px; letter-spacing: -.04em; }
.notes-dialog p { margin: 16px 0 23px; color: var(--muted, #78847c); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.notes-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.notes-btn-danger { border-color: #ad423a; background: #ad423a; color: #fff; }
.notes-btn-danger:hover { border-color: #97372f; background: #97372f; }
.notes-copy-buffer { position: fixed; top: -10000px; left: -10000px; }
.notes-layout [hidden], .notes-storage-warning[hidden] { display: none !important; }
@media (max-width: 1080px) {
  .notes-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 16px; }
  .notes-editor { padding: 23px; }
  .notes-table-heading, .notes-row { grid-template-columns: minmax(70px, 1.2fr) minmax(57px, .7fr) minmax(70px, 1fr) minmax(75px, 1fr) 28px; gap: 7px; }
  .notes-input { padding: 10px 8px; }
}
@media (max-width: 840px) {
  .notes-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; gap: 15px; }
  .notes-sidebar { gap: 12px; padding: 17px; }
  .notes-sidebar-heading { float: left; }
  .notes-new { width: auto; align-self: flex-start; }
  .notes-list { flex-direction: row; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; }
  .notes-entry { width: 176px; flex: 0 0 176px; padding: 12px; border-color: var(--border, #e3e8e3); }
  .notes-sidebar-empty { margin: 0; white-space: normal; }
  .notes-local-hint { margin: 0; padding-top: 0; font-size: 10px; }
  .notes-editor { padding: 24px; }
  .notes-empty { min-height: 330px; }
}
@media (max-width: 560px) {
  .notes-editor { padding: 20px 16px; }
  .notes-editor-header { flex-direction: column; gap: 3px; }
  .notes-title-label { width: 100%; }
  .notes-title-input { font-size: 22px; }
  .notes-saved { font-size: 10px; }
  .notes-toolbar { gap: 6px; margin: 19px 0 20px; }
  .notes-toolbar .notes-btn { padding: 9px 10px; min-height: 38px; }
  .notes-delete-note { margin-left: 0; }
  .notes-table-heading { display: none; }
  .notes-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 12px 10px; margin-bottom: 12px; padding: 15px; border: 1px solid var(--border, #e3e8e3); border-radius: 15px; }
  .notes-field-label { display: block; margin-bottom: 6px; color: var(--muted, #78847c); font-size: 10px; font-weight: 500; }
  .notes-field-description { grid-column: 1 / 3; grid-row: 1; }
  .notes-field-quantity { grid-column: 1; grid-row: 2; }
  .notes-field-unitPrice { grid-column: 2 / 4; grid-row: 2; }
  .notes-row-amount { display: flex; align-items: center; justify-content: space-between; gap: 14px; grid-column: 1 / -1; grid-row: 3; padding-top: 11px; border-top: 1px solid var(--border, #e3e8e3); }
  .notes-row-amount .notes-field-label { margin: 0; white-space: nowrap; }
  .notes-amount { font-size: 17px; }
  .notes-remove-row { grid-column: 3; grid-row: 1; align-self: end; min-height: 42px; }
  .notes-row-error { grid-row: 4; }
  .notes-input { min-height: 44px; font-size: 16px; }
  .notes-add-row { margin-top: 0; width: 100%; min-height: 44px; }
  .notes-total { align-items: flex-start; margin-top: 21px; padding: 20px 16px; gap: 12px; }
  .notes-total-value { font-size: 27px; }
  .notes-total-hint { max-width: 74px; line-height: 1.6; }
  .notes-help { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .notes-btn { transition: none; } }
