@view-transition {
  navigation: auto;
}

:root {
  --text-primary: #e4e4e7;
  --text-secondary: rgba(228, 228, 231, 0.8);
  --text-tertiary: rgba(228, 228, 231, 0.6);
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #0f2027 0%, #203a43 100%);
  color: #e4e4e7;
  min-height: 100%;
  overflow-x: hidden;
}

.dashboard-wrapper {
  display: flex;
  min-height: 100%;
  width: 100%;
}

/* Main layout */

.main-content {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
  height: 100%;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 48px;
  gap: 32px;
}

.greeting-section {
  flex: 1;
}

.greeting {
  font-size: 42px;
  font-weight: 700;
  margin: 0 0 16px 0;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.datetime-display {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.time {
  font-size: 42px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.date {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Widgets */

.widgets-section {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

.weather-widget {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 28px;
  min-width: 180px;
  text-align: center;
  flex-shrink: 0;
}

.custom-widget {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 28px;
  min-width: 180px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* (Optional future) add-widget box */

.add-widget-box {
  background: rgba(45, 212, 191, 0.1);
  border: 2px dashed rgba(45, 212, 191, 0.4);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 24px 28px;
  min-width: 180px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.add-widget-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.6);
}

.add-widget-icon {
  font-size: 42px;
  color: rgba(45, 212, 191, 0.8);
  margin-bottom: 8px;
}

.add-widget-text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(45, 212, 191, 0.9);
}

.widget-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
  opacity: 0;
  transition: all 0.3s ease;
}

.custom-widget:hover .widget-actions {
  opacity: 1;
}

.weather-location {
  font-size: 14px;
  font-weight: 600;
  color: rgba(228, 228, 231, 0.8);
  margin-bottom: 8px;
}

.weather-temp {
  font-size: 36px;
  font-weight: 700;
  color: #2dd4bf;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}

.weather-icon {
  font-size: 48px;
  margin: 12px 0;
  line-height: 1;
}

.weather-condition {
  font-size: 14px;
  font-weight: 500;
  color: rgba(228, 228, 231, 0.7);
}

.widget-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(228, 228, 231, 0.8);
  margin-bottom: 12px;
}

.widget-content {
  font-size: 13px;
  color: rgba(228, 228, 231, 0.7);
  line-height: 1.6;
}

.widget-split-layout {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex: 1;
}

.widget-split-box {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: rgba(228, 228, 231, 0.7);
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
}

.widget-quad-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  flex: 1;
}

.widget-quad-box {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: rgba(228, 228, 231, 0.7);
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* Grid / Tiles */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.tile {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(45, 212, 191, 0.3);
  border-color: rgba(45, 212, 191, 0.5);
}

.tile-icon {
  font-size: 40px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.tile-icon img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.tile-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  position: relative;
  z-index: 1;
}

.tile-url {
  font-size: 14px;
  color: rgba(228, 228, 231, 0.6);
  margin-top: 8px;
  word-break: break-all;
}

.add-tile {
  background: rgba(45, 212, 191, 0.1);
  border: 2px dashed rgba(45, 212, 191, 0.4);
}

.add-icon {
  font-size: 52px;
  color: rgba(45, 212, 191, 0.8);
  margin-bottom: 12px;
}

/* Buttons / Settings */

.settings-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-top: 16px;
}

/* Floating Page Settings Button */
.floating-settings {
  position: fixed;
  bottom: 30px;
  left: 40px;
  width: auto;        /* Don't stretch */
  padding: 12px 22px;
  z-index: 2000;
  border-radius: 12px;
}


.settings-btn:hover {
  background: rgba(45, 212, 191, 0.1);
  border-color: rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
}

.settings-btn.active {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.5);
  color: #2dd4bf;
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.3);
}

/* Category manager */

.category-manager {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.category-manager-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 16px 0;
  padding: 0 16px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: all 0.3s ease;
  cursor: grab;
  user-select: none;
}

.category-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.drag-handle {
  color: rgba(228, 228, 231, 0.4);
  font-size: 16px;
  cursor: grab;
}

.category-item-name {
  flex: 1;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 500;
}

.delete-category-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.delete-category-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.add-category-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding: 0;
}

.add-category-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #e4e4e7;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.add-category-input:focus {
  outline: none;
  border-color: #2dd4bf;
  background: rgba(255, 255, 255, 0.08);
}

.add-category-input::placeholder {
  color: rgba(228, 228, 231, 0.4);
}

.add-category-btn {
  background: rgba(45, 212, 191, 0.2);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
  width: 100%;
  padding: 10px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  font-family: inherit;
}

.add-category-btn:hover {
  background: rgba(45, 212, 191, 0.3);
}

/* Recent row */

.recent-section {
  margin-bottom: 40px;
  padding-top: 12px;
  max-width: 100%;          /* you can tweak this width */
  margin-left: auto;
  margin-right: auto;
}

.recent-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 16px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
}

.recent-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  padding-top: 6px;
  justify-content: center;
}

.recent-row::-webkit-scrollbar {
  height: 6px;
}

.recent-row::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.recent-row::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.3);
  border-radius: 3px;
}

.recent-row::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.5);
}

.recent-tile {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 14px 18px;
  min-width: 100px;
  flex-shrink: 0;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.recent-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.4);
}

.recent-tile-icon {
  font-size: 24px;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
}

.recent-tile-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.recent-tile-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  position: relative;
  z-index: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Search */

.search-section {
  margin-bottom: 32px;
}

.search-bar {
  position: relative;
  max-width: 600px;
}

.search-input {
  width: 100%;
  padding: 16px 48px 16px 48px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  color: #e4e4e7;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.search-input:focus {
  outline: none;
  border-color: #2dd4bf;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(45, 212, 191, 0.2);
}

.search-input::placeholder {
  color: rgba(228, 228, 231, 0.4);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: rgba(228, 228, 231, 0.5);
  pointer-events: none;
}

.clear-search {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: rgba(228, 228, 231, 0.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.3s ease;
}

.clear-search:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #e4e4e7;
}

.clear-search.visible {
  display: flex;
}

/* Modal */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 32px 0;
  color: #e4e4e7;
}

.modal-open .floating-settings {
  opacity: 0.35;
  filter: blur(1px);
  pointer-events: none;   /* not clickable */
}

/* Form */

.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: #e4e4e7;
  font-size: 16px;
  font-family: inherit;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #2dd4bf;
  background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
  color: rgba(228, 228, 231, 0.4);
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23e4e4e7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
  cursor: pointer;
}

select.form-input option {
  background: #1e293b;
  color: #e4e4e7;
  padding: 12px 16px;
}

/* Modal buttons */

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}

.btn {
  flex: 1;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(45, 212, 191, 0.4);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Tile actions */

.tile-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 2;
  opacity: 0;
  transition: all 0.3s ease;
}

.tile:hover .tile-actions {
  opacity: 1;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #e4e4e7;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.delete-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.3);
}

.edit-btn {
  background: rgba(45, 212, 191, 0.2);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
}

.edit-btn:hover {
  background: rgba(45, 212, 191, 0.3);
}

/* Sidebar spacer */

.sidebar-spacer {
  flex: 1;
}

/* Theme modal */

.theme-modal-section {
  margin-bottom: 32px;
}

.theme-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #e4e4e7;
  margin-bottom: 16px;
}

.theme-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.theme-color-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.theme-color-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-color-btn.active {
  border-color: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.3);
}

.theme-color-btn.active::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Widget toggles */

.widget-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.widget-toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.widget-toggle-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.widget-toggle-label {
  font-size: 15px;
  font-weight: 500;
  color: #e4e4e7;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-switch.active {
  background: linear-gradient(135deg, #2dd4bf 0%, #14b8a6 100%);
  border-color: transparent;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active::after {
  left: 24px;
}

/* Layout options (widget modal) */

.layout-selection {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.layout-option {
  flex: 1;
  min-width: 120px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.layout-option:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(45, 212, 191, 0.4);
}

.layout-option.active {
  background: rgba(45, 212, 191, 0.15);
  border-color: rgba(45, 212, 191, 0.6);
  box-shadow: 0 0 0 2px rgba(45, 212, 191, 0.2);
}

.layout-preview {
  width: 80px;
  height: 60px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.layout-box {
  background: rgba(45, 212, 191, 0.4);
  border-radius: 4px;
  transition: all 0.3s ease;
}

.layout-option.active .layout-box {
  background: rgba(45, 212, 191, 0.7);
}

.layout-box.full {
  width: 100%;
  height: 100%;
}

.layout-box.half {
  width: calc(50% - 2px);
  height: 100%;
}

.layout-box.quarter {
  width: calc(50% - 2px);
  height: calc(50% - 2px);
}

.layout-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(228, 228, 231, 0.8);
  text-align: center;
}

.layout-option.active .layout-name {
  color: #2dd4bf;
}

/* ========== LAPTOPS / SMALL DESKTOPS (≤ 1279px) ========== */
@media (max-width: 1279px) {
  .main-content {
    padding: 32px;
  }

  .greeting {
    font-size: 36px;
  }

  .time {
    font-size: 36px;
  }

  .date {
    font-size: 18px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
  }

  .tile {
    padding: 24px 18px;
  }

  .recent-section {
    max-width: 80%;
  }
}

/* ========== TABLETS (≤ 1023px) ========== */
@media (max-width: 1023px) {

  /* Keep header on ONE ROW */
  .header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
  }

  /* Keep weather widget on the right (no wrapping) */
  .widgets-section {
    display: flex;
    flex-shrink: 0;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 16px;
  }

  .screen-content {
    padding: 24px;
  }

  .weather-widget {
    padding: 20px 22px;
  }

  .search-section {
    margin-bottom: 28px;
  }

  .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
  }

  .tile {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .recent-section {
    max-width: 520px;
  }
}


/* ========== MOBILE (≤ 767px) ========== */
@media (max-width: 767px) {
  /* Hide the header (greeting + time/date + weather) on phones */
  .header {
    display: none;
  }

  .main-content {
    padding: 16px 16px 80px; /* some room at bottom for floating button */
  }

  /* Recent section: full-width but still centered content */
  .recent-section {
    max-width: 100%;
    padding: 0 8px;
    margin-bottom: 24px;
  }

  .recent-row {
    gap: 12px;
  }

  /* Search bar fills width nicely */
  .search-section {
    margin-bottom: 24px;
  }

  .search-bar {
    max-width: 100%;
  }

  .search-input {
    padding: 12px 44px 12px 44px;
    font-size: 14px;
  }

  /* Main shortcuts smaller on mobile */
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    margin-bottom: 32px;
  }

  .tile {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .tile-icon {
    font-size: 30px;
    min-height: 30px;
    margin-bottom: 12px;
  }

  .tile-icon img {
    width: 30px;
    height: 30px;
  }

  .tile-name {
    font-size: 15px;
  }

  .tile-url {
    font-size: 12px;
  }

  /* Recent tiles slightly tighter */
  .recent-tile {
    padding: 12px 14px;
    min-width: 90px;
  }

  .recent-tile-icon {
    font-size: 20px;
    margin-bottom: 6px;
  }

  .recent-tile-icon img {
    width: 20px;
    height: 20px;
  }

  .recent-tile-name {
    font-size: 11px;
  }

  /* Floating Page Settings button stays, just a bit smaller/inset */
  .floating-settings {
    bottom: 16px;
    left: 16px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
  }
}
