:root {
  --tf-bg: #f7f7f5;
  --tf-surface: #ffffff;
  --tf-border: #e2e2df;
  --tf-text: #1f1f1d;
  --tf-text-muted: #6b6b66;
  --tf-accent: #2f6f4f;
  --tf-accent-soft: #e4f0e9;
  --tf-danger: #b3441f;
  --tf-radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--tf-bg);
  color: var(--tf-text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  line-height: 1.5;
}

.tf-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.tf-page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.tf-page-header h1 {
  font-size: 1.75rem;
  margin: 0;
}

.tf-page-nav {
  display: flex;
  gap: 1rem;
}

.tf-nav-link {
  color: var(--tf-accent);
  text-decoration: none;
  font-weight: 600;
}

.tf-nav-link:hover {
  text-decoration: underline;
}

.tf-loading,
.tf-empty {
  color: var(--tf-text-muted);
  padding: 1rem 0;
}

.tf-energy-summary {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.tf-energy-summary--incomplete {
  color: var(--tf-text-muted);
  display: block;
}

.tf-energy-ring {
  --tf-ring-pct: 0%;
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    var(--tf-accent) var(--tf-ring-pct),
    var(--tf-accent-soft) var(--tf-ring-pct)
  );
}

.tf-energy-ring-fill {
  position: absolute;
  inset: 8px;
  background: var(--tf-surface);
  border-radius: 50%;
}

.tf-energy-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.tf-energy-ring-value {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tf-energy-ring-label {
  font-size: 0.65rem;
  color: var(--tf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tf-macro-list {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0;
}

.tf-macro-list div {
  display: flex;
  flex-direction: column;
}

.tf-macro-list dt {
  font-size: 0.7rem;
  color: var(--tf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tf-macro-list dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.tf-energy-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--tf-danger);
  font-size: 0.85rem;
}

.tf-item-list,
.tf-block-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tf-item,
.tf-block,
.tf-week-day {
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  padding: 1rem;
}

.tf-item--completed {
  opacity: 0.7;
}

.tf-item-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.tf-item-type,
.tf-phase-badge,
.tf-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--tf-accent-soft);
  color: var(--tf-accent);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}

.tf-item-time {
  color: var(--tf-text-muted);
  font-variant-numeric: tabular-nums;
}

.tf-item-title {
  font-weight: 600;
}

.tf-source-badge {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--tf-text-muted);
}

.tf-item-description {
  color: var(--tf-text-muted);
  margin: 0.4rem 0 0;
}

.tf-item-actions,
.tf-block-actions,
.tf-week-item-actions,
.tf-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

button {
  font: inherit;
  border: 1px solid var(--tf-border);
  background: var(--tf-surface);
  border-radius: 6px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--tf-accent);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tf-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tf-block-header h3 {
  margin: 0;
}

.tf-block-dates,
.tf-block-session-count {
  color: var(--tf-text-muted);
  margin: 0.25rem 0;
}

.tf-plan-section {
  margin-bottom: 2.5rem;
}

.tf-week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tf-week-view {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tf-week-day h3 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--tf-text-muted);
}

.tf-week-day ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tf-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--tf-border);
  padding-top: 0.5rem;
}

.tf-week-item:first-child {
  border-top: none;
  padding-top: 0;
}

.tf-week-item-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tf-item-block {
  color: var(--tf-text-muted);
  font-size: 0.85rem;
}

.tf-form {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  max-width: 420px;
}

.tf-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.5rem;
}

.tf-input {
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font: inherit;
}

.tf-field-error {
  color: var(--tf-danger);
  font-size: 0.8rem;
}

.tf-button--secondary {
  background: transparent;
}

.tf-date-nav {
  margin-bottom: 1rem;
}

.tf-meal-section {
  margin-bottom: 1.25rem;
}

.tf-meal-section h3 {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.tf-food-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.tf-food-entry {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: var(--tf-radius);
  padding: 0.6rem 0.85rem;
}

.tf-food-entry-name {
  font-weight: 600;
  flex: 1;
}

.tf-food-entry-qty,
.tf-food-entry-kcal {
  color: var(--tf-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tf-food-search {
  max-width: 480px;
}

.tf-food-search input[type='search'] {
  width: 100%;
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  font: inherit;
}

.tf-food-search-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-height: 260px;
  overflow-y: auto;
}

.tf-food-search-results button {
  width: 100%;
  text-align: left;
  background: var(--tf-surface);
  border: 1px solid var(--tf-border);
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
}

.tf-unverified-hint {
  color: var(--tf-text-muted);
  font-size: 0.8rem;
}

.tf-log-entry-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
/*
  normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
*/

.rw-scaffold *,
.rw-scaffold ::after,
.rw-scaffold ::before {
  box-sizing: inherit;
}
.rw-scaffold main {
  color: #4a5568;
  display: block;
}
.rw-scaffold h1,
.rw-scaffold h2 {
  margin: 0;
}
.rw-scaffold a {
  background-color: transparent;
}
.rw-scaffold ul {
  margin: 0;
  padding: 0;
}
.rw-scaffold input {
  font-family: inherit;
  font-size: 100%;
  overflow: visible;
}
.rw-scaffold input:-ms-input-placeholder {
  color: #a0aec0;
}
.rw-scaffold input::-ms-input-placeholder {
  color: #a0aec0;
}
.rw-scaffold input::placeholder {
  color: #a0aec0;
}
.rw-scaffold table {
  border-collapse: collapse;
}

/*
  Style
*/

.rw-scaffold,
.rw-toast {
  background-color: #fff;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji';
}
.rw-header {
  display: flex;
  justify-content: space-between;
  padding: 1rem 2rem 1rem 2rem;
}
.rw-main {
  margin-left: 1rem;
  margin-right: 1rem;
  padding-bottom: 1rem;
}
.rw-segment {
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: #e5e7eb;
  overflow: hidden;
  width: 100%;
  scrollbar-color: #a1a1aa transparent;
}
.rw-segment::-webkit-scrollbar {
  height: initial;
}
.rw-segment::-webkit-scrollbar-track {
  background-color: transparent;
  border-color: #e2e8f0;
  border-style: solid;
  border-radius: 0 0 10px 10px;
  border-width: 1px 0 0 0;
  padding: 2px;
}
.rw-segment::-webkit-scrollbar-thumb {
  background-color: #a1a1aa;
  background-clip: content-box;
  border: 3px solid transparent;
  border-radius: 10px;
}
.rw-segment-header {
  background-color: #e2e8f0;
  color: #4a5568;
  padding: 0.75rem 1rem;
}
.rw-segment-main {
  background-color: #f7fafc;
  padding: 1rem;
}
.rw-link {
  color: #4299e1;
  text-decoration: underline;
}
.rw-link:hover {
  color: #2b6cb0;
}
.rw-forgot-link {
  font-size: 0.75rem;
  color: #a0aec0;
  text-align: right;
  margin-top: 0.1rem;
}
.rw-forgot-link:hover {
  font-size: 0.75rem;
  color: #4299e1;
}
.rw-heading {
  font-weight: 600;
}
.rw-heading.rw-heading-primary {
  font-size: 1.25rem;
}
.rw-heading.rw-heading-secondary {
  font-size: 0.875rem;
}
.rw-heading .rw-link {
  color: #4a5568;
  text-decoration: none;
}
.rw-heading .rw-link:hover {
  color: #1a202c;
  text-decoration: underline;
}
.rw-cell-error {
  font-size: 90%;
  font-weight: 600;
}
.rw-form-wrapper {
  box-sizing: border-box;
  font-size: 0.875rem;
  margin-top: -1rem;
}
.rw-cell-error,
.rw-form-error-wrapper {
  padding: 1rem;
  background-color: #fff5f5;
  color: #c53030;
  border-width: 1px;
  border-color: #feb2b2;
  border-radius: 0.25rem;
  margin: 1rem 0;
}
.rw-form-error-title {
  margin-top: 0;
  margin-bottom: 0;
  font-weight: 600;
}
.rw-form-error-list {
  margin-top: 0.5rem;
  list-style-type: disc;
  list-style-position: inside;
}
.rw-button {
  border: none;
  color: #718096;
  cursor: pointer;
  display: flex;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 1rem;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.025em;
  border-radius: 0.25rem;
  line-height: 2;
  border: 0;
}
.rw-button:hover {
  background-color: #718096;
  color: #fff;
}
.rw-button.rw-button-small {
  font-size: 0.75rem;
  border-radius: 0.125rem;
  padding: 0.25rem 0.5rem;
  line-height: inherit;
}
.rw-button.rw-button-green {
  background-color: #48bb78;
  color: #fff;
}
.rw-button.rw-button-green:hover {
  background-color: #38a169;
  color: #fff;
}
.rw-button.rw-button-blue {
  background-color: #3182ce;
  color: #fff;
}
.rw-button.rw-button-blue:hover {
  background-color: #2b6cb0;
}
.rw-button.rw-button-red {
  background-color: #e53e3e;
  color: #fff;
}
.rw-button.rw-button-red:hover {
  background-color: #c53030;
}
.rw-button-icon {
  font-size: 1.25rem;
  line-height: 1;
  margin-right: 0.25rem;
}
.rw-button-group {
  display: flex;
  justify-content: center;
  margin: 0.75rem 0.5rem;
}
.rw-button-group .rw-button {
  margin: 0 0.25rem;
}
.rw-form-wrapper .rw-button-group {
  margin-top: 2rem;
  margin-bottom: 0;
}
.rw-label {
  display: block;
  margin-top: 1.5rem;
  color: #4a5568;
  font-weight: 600;
  text-align: left;
}
.rw-label.rw-label-error {
  color: #c53030;
}
.rw-input {
  display: block;
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.5rem;
  border-width: 1px;
  border-style: solid;
  border-color: #e2e8f0;
  color: #4a5568;
  border-radius: 0.25rem;
  outline: none;
}
.rw-check-radio-item-none {
  color: #4a5568;
}
.rw-check-radio-items {
  display: flex;
  justify-items: center;
}
.rw-input[type='checkbox'] {
  display: inline;
  width: 1rem;
  margin-left: 0;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}
.rw-input[type='radio'] {
  display: inline;
  width: 1rem;
  margin-left: 0;
  margin-right: 0.5rem;
  margin-top: 0.25rem;
}
.rw-input:focus {
  border-color: #a0aec0;
}
.rw-input-error {
  border-color: #c53030;
  color: #c53030;
}

.rw-input-error:focus {
  outline: none;
  border-color: #c53030;
  box-shadow: 0 0 5px #c53030;
}

.rw-field-error {
  display: block;
  margin-top: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: #c53030;
}
.rw-table-wrapper-responsive {
  overflow-x: auto;
}
.rw-table-wrapper-responsive .rw-table {
  min-width: 48rem;
}
.rw-table {
  table-layout: auto;
  width: 100%;
  font-size: 0.875rem;
}
.rw-table th,
.rw-table td {
  padding: 0.75rem;
}
.rw-table td {
  background-color: #ffffff;
  color: #1a202c;
}
.rw-table tr:nth-child(odd) td,
.rw-table tr:nth-child(odd) th {
  background-color: #f7fafc;
}
.rw-table thead tr {
  color: #4a5568;
}
.rw-table th {
  font-weight: 600;
  text-align: left;
}
.rw-table thead th {
  background-color: #e2e8f0;
  text-align: left;
}
.rw-table tbody th {
  text-align: right;
}
@media (min-width: 768px) {
  .rw-table tbody th {
    width: 20%;
  }
}
.rw-table tbody tr {
  border-top-width: 1px;
}
.rw-table input {
  margin-left: 0;
}
.rw-table-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  height: 17px;
  padding-right: 0.25rem;
}
.rw-table-actions .rw-button {
  background-color: transparent;
}
.rw-table-actions .rw-button:hover {
  background-color: #718096;
  color: #fff;
}
.rw-table-actions .rw-button-blue {
  color: #3182ce;
}
.rw-table-actions .rw-button-blue:hover {
  background-color: #3182ce;
  color: #fff;
}
.rw-table-actions .rw-button-red {
  color: #e53e3e;
}
.rw-table-actions .rw-button-red:hover {
  background-color: #e53e3e;
  color: #fff;
}
.rw-text-center {
  text-align: center;
}
.rw-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24rem;
  margin: 4rem auto;
  flex-wrap: wrap;
}
.rw-login-container .rw-form-wrapper {
  width: 100%;
  text-align: center;
}
.rw-login-link {
  margin-top: 1rem;
  color: #4a5568;
  font-size: 90%;
  text-align: center;
  flex-basis: 100%;
}
.rw-webauthn-wrapper {
  margin: 1.5rem 1rem 1rem;
  line-height: 1.4;
}
.rw-webauthn-wrapper h2 {
  font-size: 150%;
  font-weight: bold;
  margin-bottom: 1rem;
}
