* { box-sizing: border-box; }

body {
  margin: 16px 20px 32px;
  color: #000;
  background: #fff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
}

h1 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.top h1 { margin: 0; }

#sign-out,
button.google {
  font: inherit;
  padding: 4px 10px;
}

.login-panel { max-width: 28rem; }

.login-panel p { margin: 0 0 12px; line-height: 1.4; }

#sign-in-error { color: #b00000; min-height: 1.2em; }

#kraken-error {
  margin: 0 0 10px;
  color: #b00000;
  max-width: 52rem;
}

form.entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 12px;
}

form.entry[hidden] { display: none; }

form.entry label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

form.entry input,
form.entry select,
form.entry button {
  font: inherit;
}

#entry-note { color: #333; }

.tabs {
  display: flex;
  gap: 2px;
  margin: 0 0 12px;
  border-bottom: 1px solid #b7b7b7;
}

.tab {
  font: inherit;
  margin: 0 0 -1px;
  padding: 6px 12px;
  color: #000;
  background: #f3f3f3;
  border: 1px solid #b7b7b7;
  border-bottom-color: #b7b7b7;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  font-weight: 700;
  background: #fff;
  border-bottom-color: #fff;
}

.tab[hidden] { display: none; }

#panel-history[hidden],
#panel-sheet[hidden],
#panel-portfolio[hidden] { display: none; }

.ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
}

.ranges button {
  font: inherit;
  padding: 4px 10px;
  color: #000;
  background: #f3f3f3;
  border: 1px solid #b7b7b7;
  cursor: pointer;
}

.ranges button[aria-pressed="true"] {
  font-weight: 700;
  background: #fff;
}

#portfolio-total {
  margin: 0 0 8px;
  font-weight: 700;
}

#portfolio-note,
#portfolio-error {
  margin: 0 0 8px;
  max-width: 40rem;
}

#portfolio-error { color: #b00000; }

#portfolio-chart {
  display: block;
  width: 100%;
  max-width: 720px;
  height: 180px;
  margin: 0 0 12px;
  background: #fff;
  border: 1px solid #b7b7b7;
}

#portfolio-chart[hidden] { display: none; }

.wrap { overflow-x: auto; }

table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

caption.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

th, td {
  border: 1px solid #b7b7b7;
  padding: 4px 8px;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  height: 36px;
}

td { text-align: right; height: 24px; }
td.name, th.name { text-align: left; min-width: 7.5rem; }
#history td:first-child { text-align: left; }
.pos { color: #008000; }
.nil { color: #0044cc; }
.neg { color: #c00000; }

th.gap, td.gap {
  width: 18px;
  min-width: 18px;
  border: 0;
  background: #fff;
  padding: 0;
}

th.name { background: #d0d0d0; }
th.share { background: #6aa84f; }
th.cost, th.wpct { background: #e69138; }
th.value { background: #c44bc4; color: #fff; }
th.czk { background: #6fa8dc; }
th.pl { background: #efefef; }
th.brutto { background: #f1c232; }
th.deposit { background: #93c47d; }
th.withdraw { background: #76a5af; }
th.var { background: #ffe599; }
th.var-value { background: #ffe599; min-width: 8.5rem; }

td.name { background: #f3f3f3; font-weight: 600; }
td.share { background: #d9ead3; }
td.cost, td.wpct { background: #fce5cd; }
td.value { background: #ead1dc; }
td.czk { background: #cfe2f3; }
td.pl { background: #fff; }
td.brutto { background: #fff2cc; }
td.deposit { background: #d9ead3; }
td.withdraw { background: #d0e0e3; }
td.var { background: #fff2cc; text-align: left; font-weight: 600; }
td.var-value {
  background: #fff;
  text-align: right;
  white-space: normal;
  max-width: 18rem;
}
td.var-value.rate { background: #ffe599; }
td.var-value .date { display: block; font-weight: 400; color: #333; }

tr.total td.name { background: #e6e6e6; }
tr.total td.share { background: #b6d7a8; }
tr.total td.cost, tr.total td.wpct { background: #f9cb9c; }
tr.total td.value { background: #d5a6bd; }
tr.total td.czk { background: #9fc5e8; }
tr.total td.brutto { background: #ffe599; }
tr.total td.deposit { background: #b6d7a8; }
tr.total td.withdraw { background: #a2c4c9; }

td.blank {
  background: #f3f3f3;
  border-color: #d9d9d9;
}

body.login-page {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: hsl(221 84% 5%);
  font-family: Inter, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body.login-page .login-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

body.login-page .login-photo {
  position: absolute;
  inset: 0;
  background: url("./hero-lifestyle.jpg") center / cover no-repeat;
}

body.login-page .login-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, hsl(221 84% 5% / 0.72), hsl(221 84% 5% / 0.42)),
    linear-gradient(45deg, hsl(330 91% 65% / 0.12), transparent);
}

body.login-page .login-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.2;
  animation: login-float 3s ease-in-out infinite;
}

body.login-page .login-orb-pink {
  left: 2.5rem;
  bottom: 2.5rem;
  width: 5rem;
  height: 5rem;
  background: linear-gradient(135deg, hsl(330 91% 65%), hsl(340 82% 52%));
}

body.login-page .login-orb-ocean {
  top: 5rem;
  right: 5rem;
  width: 4rem;
  height: 4rem;
  background: linear-gradient(135deg, hsl(193 82% 31%), hsl(199 89% 48%));
  animation-delay: 1s;
}

body.login-page .login-orb-sunset {
  right: 2.5rem;
  bottom: 5rem;
  width: 3rem;
  height: 3rem;
  background: linear-gradient(135deg, hsl(45 93% 58%), hsl(330 91% 65%));
  animation-delay: 2s;
}

@keyframes login-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes login-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

body.login-page .login-header {
  position: relative;
  z-index: 2;
  background: hsl(0 0% 100% / 0.1);
  border-bottom: 1px solid hsl(0 0% 100% / 0.1);
  backdrop-filter: blur(12px);
}

body.login-page .login-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}

body.login-page .login-brand img {
  display: block;
  height: 40px;
  width: auto;
}

body.login-page .login-brand span {
  font-size: 1.25rem;
  font-weight: 700;
}

body.login-page .login-panel {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
  text-align: center;
  animation: login-fade-in 0.6s ease-out;
}

body.login-page h1 {
  margin: 0 0 1.25rem;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.35rem, 6.5vw, 4.5rem);
  font-weight: 700;
  line-height: 1.12;
  color: #fff;
  text-wrap: balance;
}

body.login-page h1 .login-highlight {
  background: linear-gradient(135deg, hsl(330 91% 65%), hsl(340 82% 52%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

body.login-page .login-lead {
  margin: 0 auto 2rem;
  max-width: 28rem;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  color: hsl(0 0% 100% / 0.8);
  text-wrap: balance;
}

body.login-page button.google {
  font-family: Inter, system-ui, sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(135deg, hsl(330 91% 65%), hsl(340 82% 52%));
  border: 0;
  border-radius: 0.5rem;
  padding: 1rem 2rem;
  box-shadow: 0 25px 50px -12px hsl(330 91% 65% / 0.25);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.login-page button.google:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px hsl(193 82% 31% / 0.25);
}

body.login-page button.google:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

body.login-page button.google:disabled {
  cursor: default;
  opacity: 0.72;
}

body.login-page #sign-in-error {
  margin: 1rem 0 0;
  max-width: 28rem;
  color: #ffe4e6;
  min-height: 1.4em;
}

@media (max-width: 640px) {
  body.login-page .login-panel {
    padding: 1.75rem 1.25rem 2.25rem;
  }

  body.login-page button.google {
    width: min(100%, 22rem);
  }

  body.login-page .login-orb-ocean {
    top: 4.5rem;
    right: 1rem;
  }

  body.login-page .login-orb-pink {
    left: 0.75rem;
    bottom: 1rem;
  }

  body.login-page .login-orb-sunset {
    right: 0.75rem;
    bottom: 4.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.login-page .login-orb,
  body.login-page .login-panel,
  body.login-page button.google {
    animation: none;
    transition: none;
  }
}
