:root {
  --pomodoro-color: #ba4949;
  --short-break-color: #38858a;
  --long-break-color: #397097;
  --text-on-color: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text-on-color);
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.theme-pomodoro { background-color: var(--pomodoro-color); }
body.theme-short-break { background-color: var(--short-break-color); }
body.theme-long-break { background-color: var(--long-break-color); }

.topbar {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1rem 0.5rem;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-on-color);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.logout-form {
  display: inline;
  margin: 0;
}

.timer-card {
  width: 100%;
  max-width: 420px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  margin: 1rem;
  padding: 1.5rem;
  text-align: center;
}

.mode-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.mode-tab {
  background: none;
  border: none;
  color: var(--text-on-color);
  opacity: 0.7;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  cursor: pointer;
}

.mode-tab.active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.15);
}

.time-display {
  font-size: 5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 1.5rem;
  font-variant-numeric: tabular-nums;
}

.start-btn {
  background: var(--text-on-color);
  color: var(--pomodoro-color);
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  padding: 1rem 3rem;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.2);
}

.start-btn:active {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(4px);
}

.focus-panel {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border-radius: 12px;
  margin: 0 1rem 2rem;
  padding: 1rem 1.25rem;
}

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

.focus-panel-header h2 {
  font-size: 1rem;
  margin: 0;
}

.focus-panel .icon-btn {
  color: #333;
  font-size: 1.1rem;
}

.focused-ticket {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #f1f1f1;
  border-radius: 8px;
  font-size: 0.9rem;
}

.ticket-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  max-height: 240px;
  overflow-y: auto;
}

.ticket-list li {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 0.9rem;
}

.ticket-list li:hover {
  background: #f7f7f7;
}

.ticket-list li.selected {
  background: #eef6f6;
  font-weight: 600;
}

.ticket-identifier {
  font-weight: 700;
  margin-right: 0.4rem;
}

.ticket-link-out {
  float: right;
  color: #999;
  text-decoration: none;
}

.ticket-link-out:hover {
  color: #333;
}

.hidden {
  display: none !important;
}

.banner {
  width: 100%;
  background: #ffe8b3;
  color: #6b4a00;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.banner-actions button {
  border: none;
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #fff;
  color: #333;
  border-radius: 12px;
  padding: 1.5rem;
  width: 90%;
  max-width: 360px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
}

.setting-row input[type="number"] {
  width: 70px;
  padding: 0.3rem;
}

.setting-row input[type="range"] {
  width: 120px;
}

.setting-inline {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.setting-inline select {
  padding: 0.3rem;
}

.setting-inline .icon-btn {
  color: #333;
  font-size: 0.9rem;
  padding: 0.15rem 0.4rem;
}

.checkbox-row {
  justify-content: flex-start;
  gap: 0.5rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-primary, .btn-secondary {
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  font-weight: 600;
}

.btn-primary {
  background: var(--pomodoro-color);
  color: #fff;
}

.btn-secondary {
  background: #eee;
  color: #333;
}

.login-card {
  width: 100%;
  max-width: 360px;
  margin: 4rem auto 0;
  padding: 0 1rem;
  text-align: center;
}

.login-brand {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.login-form {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border-radius: 12px;
  padding: 1.5rem;
}

.login-label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.login-input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.login-submit {
  width: 100%;
  padding: 0.8rem;
  font-size: 1rem;
  box-shadow: none;
}

.login-error {
  background: #fdecea;
  color: #a33;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  margin: 0 0 1rem;
  text-align: left;
}
